| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi Folks I'm working on the Rational for Z to develop PL/i for mainframes, and a little question about substr, the following is my code fragment: ------------------------------start of code------------------------------ dcl long_char char(300) ; dcl temp_char char(10) ; dcl substr builtin; long_char = '?HELLO,??WORLD!I?LOVE?THIS?COUNTRY,?I?LIKE?IT?SO? MUCH!'; temp_char = substr(long_char,cur,10); display(long_char); display(temp_char); ----------------------------------end of code--------------------------- ---------------------------------display---------------- ?HELLO,??WORLD!I?LOVE?THIS?COUNTRY,?I?LIKE?IT?SO?M UCH!' ?HELLO,?? i suppose the first 10 characters the machine displayed will be the same, for the temp_char, there is always one more leading blank, i can't figure it out, anybody can help for that? Tks!!! |
|
#2
| |||
| |||
| ciger wrote: > Hi Folks > I'm working on the Rational for Z to develop PL/i for mainframes, > and a little question about substr, > the following is my code fragment: > ------------------------------start of > code------------------------------ > dcl long_char char(300) ; > dcl temp_char char(10) ; > dcl substr builtin; > long_char = '?HELLO,??WORLD!I?LOVE?THIS?COUNTRY,?I?LIKE?IT?SO? MUCH!'; > temp_char = substr(long_char,cur,10); > display(long_char); > display(temp_char); > ----------------------------------end of > code--------------------------- > ---------------------------------display---------------- > ?HELLO,??WORLD!I?LOVE?THIS?COUNTRY,?I?LIKE?IT?SO?M UCH!' > ?HELLO,?? > i suppose the first 10 characters the machine displayed will be the > same, for the temp_char, there is always one more leading blank, i > can't figure it out, anybody can help for that? > Tks!!! Where do you set the value of cur, the starting position of the substring function? rlbrady |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.