September 01, 2004, 06:35 PM
jbmuirEvaluating Amper vars
If I derive programmatically in a FOCEXEC the name of a parameter stored in a launch page, say 'LKUPDE' (without the ampersand), can I get the value of that parameter? What would the syntax be?
Lets pretend that the following -SET statement derives the name of a parameter on my launch page called 'LKUPDE':
-SET &MYPARM = 'LKUPDE';
Now,
-TYPE &MYPARM.EVAL
would produce the text:
LKUPDE
I would like to get the value of the amper variable &LKUPDE.
-TYPE &(&MYPARM.EVAL)
would produce the text:
&(LKUPDE)
Not what I want, and:
-TYPE &&MYPARM.EVAL
tries to evaluate the global amper variable &&MYPARM.
Any suggestions as to how I might get FOCUS to give me the value of &LKUPDE ??
-James
September 01, 2004, 07:08 PM
<Thiru>James,
From what I understand from your post is you are trying to get the value of the LKUPDE from your HTML form. Then assign it to &MYPARM. Try the code below, but now the TYPE will ask you for the value of LKUPDE since this DM command will have the &LKUPDE in this context.
-SET &MYPARM = 'LKUPDE';
-SET &MYPARM = '&' ||'LKUPDE';
-TYPE &MYPARM.EVAL
I dont know this has answered your post.
--Thiru
September 01, 2004, 07:16 PM
susannahuse the escape character
-SET &MYVAR = '&|' | 'MVAR1';
-TYPE &MYVAR
The eval isn't necessary, in this case.
Only if you expect the &var to perform something.
September 01, 2004, 08:58 PM
jbmuiruse the escape character - this is interesting and produces the desired result!
-SET &MYVAR = '&|' | 'MVAR1';
-TYPE &MYVAR
Does the escape character defer the evaluation of the amper variable until after the concatenation? Is this what is going on?
September 01, 2004, 10:52 PM
susannahno, the escape character just tells webfocus that this ampersand is not an ampersand in the Dialog Manager sense, its just a character. It says to wf: "Don't execute it, just read it."
September 03, 2004, 03:06 PM
dhagenJust another option ... a little easier to type.
-SET &LKUPDE = 'NOTHING HERE';
-SET &MYPARM = 'LKUPDE';
-TYPE &MYPARM.EVAL
-TYPE &.&MYPARM
September 03, 2004, 03:08 PM
susannahcool