Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning DEFAULT values

Status
Not open for further replies.

craigiep

Programmer
Oct 22, 2002
47
AU
Hi

I'm trying to use a dm variable to assign a default value

ie

-SET &DEF_VAL = 'VALUE';

-DEFAULTS &RVAL = &DEF_VAL

-SET &REALVAL = &RVAL;

Instead of &RVAL taking the value 'VALUE' it takes '&DEF_VAL'.

I've tried using .EVAL without success. Can anyone help ?

thanks
 
Depends on what you want, and WHERE you put the '.EVAL'.

A -DEFAULTS statement normally only takes literals, which is why you get &DEF_VAL (as if it was a literal). But, if you put the '.EVAL' there, it will replace the value of the DM variable with its value, and work. It looks like this:

Code:
-SET &DEF_VAL = 'VALUE';
-DEFAULTS &RVAL = &DEF_VAL.EVAL
-SET &REALVAL = &RVAL;
 
Thanks for your reply, but I'd already tried that without success.

I probably should have given some more details, in that I'm trying to implement this in a default launch page in Workbench 436. I think it's got something to do with how WebFocus creates these.
 
The code I provided works for me under 4.3.6. If I pass in a value of RVAL, it's taken; if not, it takes the value set by &DEF_VAL. I think we need more information, to understand HOW it's failing.
 
In Workbench, select New Standard Report / Editor and insert the following, and then Run.

What I want is to force the launch page to prompt for &TMPCNTRY so that it can be assigned to &COUNTRY.

However, I want the default value of &TMPCNTRY to be 'JAPAN' in this instance (in reality the value may depend on something like the Userid)

The launch page prompts for &TMPCNTRY, but the box is populated with &DEFCNTRY.EVAL and not JAPAN.

-SET &DEFCNTRY = 'JAPAN';
-DEFAULTS &TMPCNTRY = &DEFCNTRY.EVAL
-SET &COUNTRY = &TMPCNTRY;
-TYPE &COUNTRY

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top