Hi, Folks, a newbie question, plz help

This is a discussion on Hi, Folks, a newbie question, plz help within the pl1 forums in Programming Languages category; 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!!!...

Go Back   Application Development Forum > Programming Languages > pl1

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-27-2008, 04:27 AM
ciger
Guest
 
Default Hi, Folks, a newbie question, plz help

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!!!
Reply With Quote
  #2  
Old 08-27-2008, 11:39 AM
Richard Brady
Guest
 
Default Re: Hi, Folks, a newbie question, plz help

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
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 02:53 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.