I am trying to change the FIELD NAME during a FOR EACH, and it will not work. When I use a variable for a field name, the field name the variable supplies is NOT looked up. Progress interprets the variable name as a character varable. How do I make Progress interpret my variable name as a field name?
Sample code:
DO i = 1 TO 2:
IF i = 1 THEN cVar = "Int1"
IF i = 2 THEN cVar = "Int2"
FOR EACH acct where
acct.cVar > 0:
DISPLAY Int1 Int2.
END.
END.
This doesn't work. Instead of using the variable, Progress is taking it literally and looking up the following:
FOR EACH acct where
"Int1" > 0:
END.
I tried Pre Processor statements, but they will not work with an IF statement.
Thank you for your help.
Sample code:
DO i = 1 TO 2:
IF i = 1 THEN cVar = "Int1"
IF i = 2 THEN cVar = "Int2"
FOR EACH acct where
acct.cVar > 0:
DISPLAY Int1 Int2.
END.
END.
This doesn't work. Instead of using the variable, Progress is taking it literally and looking up the following:
FOR EACH acct where
"Int1" > 0:
END.
I tried Pre Processor statements, but they will not work with an IF statement.
Thank you for your help.