Focal Point
[SOLVED] Setting a -DEFALUT value

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9291057703

November 18, 2008, 12:00 PM
Don Robison
[SOLVED] Setting a -DEFALUT value
Is there away to assign a –DEFAULT field with the system date?

This message has been edited. Last edited by: Kerry,


Version 7.17
November 18, 2008, 12:34 PM
Spence
-DEFAULTS &SYSTEM_DATE = &DATEMDYY;
or
-SET &SYSTEM_DATE = &YYMD;


WF 8 version 8.2.04. Windows.
In focus since 1990.
November 18, 2008, 12:44 PM
jimster06
Or if you want to set your own date for testing

SET TESTDATE = {yyyymmdd|TODAY}

This was very handy in the the days right before Y2K


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
November 18, 2008, 12:52 PM
TexasStingray
I could not get option 1 to work here is what I did.

-DEFAULTS &SYSTEM_DATE = xxxx;
-SET &SYSTEM_DATE = IF &SYSTEM_DATE EQ 'xxxx' THEN &DATEMDYY ELSE &SYSTEM_DATE;
-TYPE &SYSTEM_DATE;


Hope this helps




Scott

-DEFAULTS &SYS_DATE = &DATEMDYY;
-TYPE &SYS_DATE.EVAL


WF 8 version 8.2.04. Windows.
In focus since 1990.
-DEFAULT &MYDATE = &YYMD.EVAL ;
works for me.
but when prompting, (as in Report Caster), you need to explicitly overwrite the '&YYMD.EVAL' with a number.
When running a fex from a launch page, it works just fine.
If you want to avoid prompting (but why would you?) then
-DEFAULTH &MYDATE = &YYMD.EVAL ;

Its the .EVAL at the end that does the trick.
Without it, focus thinks you're creating a variable called &MYDATE equal tothe character string '&YYMD';




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Using .EVAL is the safest way to do this as it gets evaluated before the line is.

Be wary of -DEFAULT with multiple levels of -INCLUDEs. See 2nd -DEFAULT in -INCLUDE overrides 1st -DEFAULT in Parent


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!