RPGIV @ Work

A unique site for RPG and System i Lovers

Welcome!

Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

Split Text Print E-mail
User Rating: / 0
PoorBest 
Written by Chamara Withanachchi   

Split a text by spaces


   P doSolit         B                                          
   D doSolit         PI             1a                          
   D   inMessage                   80a                          
                                                             
   D Pos             S              3  0                        
   D reqIdx          S              2  0                        
   D rStat           S              1a                          
                                                             
    * Temporary Variables to Hold Data                          
   D arrReqMsg       S             20a    Dim(10)               
                                                             
    /Free                                                       
                                                             
       rStat = '0';                                             
                                                             
       Dow reqIdx <= 10;                                        
          Pos = %Scan(' ' : inMessage);                         
          If Pos <> *Zeros;                                     
             arrReqMsg(reqIdx) = %SubSt(inMessage : 1 : Pos);   
             inMessage = %SubSt(inMessage : Pos+1);             
             reqIdx += 1; 
             rStat = '1'; 
          EndIf;          
       EndDo;             
                       
       Return rStat;      
                       
    /End-Free             
                       
   P doSolit         E

User Comments

Please login or register to add comments

<Previous   Next>