Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Evaluating Amper vars
Go
New
Search
Notify
Tools
Reply
  
Evaluating Amper vars
 Login/Join
 
Gold member
posted
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
 
Posts: 83 | Location: Dartmouth Hitchcock Medical Center | Registered: April 17, 2003Reply With QuoteReport This Post
<Thiru>
posted
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
 
Reply With QuoteReport This Post
Expert
posted Hide Post
use 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.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
Gold member
posted Hide Post
use 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?
 
Posts: 83 | Location: Dartmouth Hitchcock Medical Center | Registered: April 17, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
no, 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."
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Just another option ... a little easier to type.

-SET &LKUPDE = 'NOTHING HERE';
-SET &MYPARM = 'LKUPDE';
-TYPE &MYPARM.EVAL
-TYPE &.&MYPARM
 
Posts: 1100 | Location: Toronto, Ontario | Registered: May 26, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
cool
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Evaluating Amper vars

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.