How do I print a value in an array in DDS

314 views Asked by At

I know this question isn't directly RPG language oriented, but I have no idea where I would turn otherwise.

I've created a PRTF in RDi for my project in class. I've set up several arrays in the RPGLE file to hold some numbers and several more like this example.

Dcl-s Freshman  Packed(5:0) Dim(4);

How do I specify that I want to print Freshman(2) in my PRTF?

I have tried things similar to these in the Functions section: Freshman(1), REFFLD(Freshman(1)), REFFLD(Freshman/1)

1

There are 1 answers

0
Charles On

A DDS based object (PRTF/DSPF/PF/LF) can only use a database file as a reference.

Otherwise, you need to define the field explicitly in the PRTF.
A FRSHMAN 5S 0 182

Now your RPG program could use the DDS defined field as a reference...
Dcl-s Freshman like(frshman) Dim(4);

or you could leave it explicitly defined as originally posted.

Either way, you'd need to manually move the data in your RPG program.
frshman = Freshman(1);