|
I have a prompt screen that has 10 selection values (Field0 through Field9) and I call a subroutine that validates these fields before submitting. So I have to step through each field, chain to a file to validate the value and then set on an indicator. My problem is getting my head around the concept. In RPG III I would have written something like:
FIELD1 CHAIN MYFILEFMT 97 *IN99 IFEQ *ONSETON 20 (Reverse Image and Highlight)
ENDIF FIELD2 CHAIN MYFILEFMT 97 *IN99 IFEQ *ONSETON 21 (Reverse Image and Highlight)
ENDIFAnd so on.....but I think I should be able to construct a DO loop to iterate through the fields.
So, first how would I reference the fields for the chain in FREE? I *don't think* I can do:
Count = 0; DOW count <10; FieldName = 'Field' + %char(count); chain FieldName MyFile; if not%found(MyFile); //seton the indicator .........etc Count = Count + 1; ENDDO;Can't do it because I think the chain will occur with the literal value 'Field0'.....
Second, with the indicator value I'd like to do something like incrementally setting on the correct indicator starting at a particular starting value plus the counter. Something like:
*in,(20 + count) = *on; although I know referencing indicator arrays in this way can't be done in /free.
Using arrays for all of this comes to mind as well.Is there a simple solution to this ? ( I have ordered a couple of books about /free but they won't arrive until after August 5th :-(
Thanks, Pete Helgren
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.