tom-writes-code / rpgle-repl

A green-screen REPL style workspace to assist with RPGLE development
MIT License
26 stars 3 forks source link

Nested data structures #19

Open tom-writes-code opened 2 years ago

tom-writes-code commented 2 years ago

repl cannot interpret nested data structures. For example, take the following code:

dcl-ds individual qualified;      
  dcl-ds name;                    
    forename char(10);            
    surname char(10);             
  end-ds;                         
  age packed(3);                  
end-ds;                           

individual.name.forename = 'Tom'; 
individual.name = individual.name;
individual.age = 32;              
individual = individual;          

The output is as follows: image

Actual output should be:


individual.name.forename = 'Tom';   // individual.name.forename = 'Tom'
individual.name = individual.name;  // individual.name.forename = 'Tom'
                                    // individual.name.surname = ''
individual.age = 32;                // individual.age = 32
individual = individual;            // individual.name.forename = 'Tom'
                                    // individual.name.surname = ''
                                    // individual.age = 32