Array has too many omitted index - Compile Time Error

Discussions relating to writing software in ILE RPG (RPG IV). This includes both fixed and free format RPG.
Post Reply
kathan.p@gmail.com
Posts: 19
Joined: Wed Aug 04, 2021 7:27 pm

Array has too many omitted index - Compile Time Error

Post by kathan.p@gmail.com »

Code: Select all

HDFTACTGRP(*no)                                                     
D data1           S           1000    inz('^test^^testing^letstest')
D delimiter1      S              1    inz('^')                      
D ArrData         S             50    dim(50) inz                   
 /Free                                                              
    ArrData = pssplitd1(data1:delimiter1);                          
    dsply arrdata;                                                  
   *inlr = *on;                                                     
 /End-Free                                                          
                                                                    
Ppssplitd1        b                                                 
Dpssplitd1        pi            50     dim(50)                      
D  data                       1000                                  
D  delimiter                     1                                  
 *                                                                  
D returnArray     s             50    dim(50)  inz                  
                                                                    
D startPos        s             10i 0                               
D foundPos        s             10i 0         


//// some code//////

return returnarray;

pssplitd1        e            
[Text]
I am getting Compile time error as "ARRAY HAS TOO MANY OMITTED INDEX'
[/Text]
brianjgarland
Posts: 14
Joined: Wed Jul 28, 2021 11:04 am
Location: Vermont, USA
Contact:

Re: Array has too many omitted index - Compile Time Error

Post by brianjgarland »

ArrData is an array you cannot do "dsply arrdata;"

You could do something like this:

Code: Select all

        FOR i = 1 TO %ELEM(arrdata);      
            dsply arrdata(i);             
        ENDFOR;                           
jonboy49
Posts: 218
Joined: Wed Jul 28, 2021 8:18 pm

Re: Array has too many omitted index - Compile Time Error

Post by jonboy49 »

Just to add to Brian's comment - even if you could display an array as you originally coded it, it would have exceeded RPG's 52 character display limit anyway.
Post Reply