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     [CLOSED] -DEFAULT DYNAMIC VALUES
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] -DEFAULT DYNAMIC VALUES
 Login/Join
 
Silver Member
posted
It appears that you cannot set a -DEFAULT value to an amper-variable.

-DEFAULT &START_DATE = &STARTDATE

The auto-prompt displays &STARTDATE. Anybody have a workaround. The .EVAL also does not work.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8

Windows, All Outputs
 
Posts: 45 | Location: Phoenix | Registered: March 01, 2018Reply With QuoteReport This Post
Virtuoso
posted Hide Post
What's the value of &STARTDATE? You're setting an & with another &.


WebFOCUS 8206, Unix, Windows
 
Posts: 1716 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
TRUE: "It appears that you cannot set a -DEFAULT value to an amper-variable."

There are work-arounds...

This message has been edited. Last edited by: Doug,
 
Posts: 3045 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
Silver Member
posted Hide Post
It really doesn't matter what the value is but if I do..

-SET &START_DATE = 06082018 ;
-DEFAULT &STARTDATE = &START_DATE

The auto-prompt displays &START_DATE


WebFOCUS 8

Windows, All Outputs
 
Posts: 45 | Location: Phoenix | Registered: March 01, 2018Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I think if you don't want the variable to prompt you have to use -DEFAULTH for hidden like this:

-SET &ECHO=ALL;
-SET &START_DATE = 06082018;
-DEFAULTH &STARTDATE = &START_DATE.EVAL;  


WebFOCUS 8206, Unix, Windows
 
Posts: 1716 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Silver Member
posted Hide Post
I want it to auto-prompt.

What I have is a -INCLUDE that sets the default start date to the previous 28 days. This works for my HTML pages but the focexecs that the users create themselves who do not use HTML pages, I don't want them to have to enter the dates every time if they don't need to change those values.


WebFOCUS 8

Windows, All Outputs
 
Posts: 45 | Location: Phoenix | Registered: March 01, 2018Reply With QuoteReport This Post
Expert
posted Hide Post
Les,
Maybe this will work:
 
-SET &DATE_LESS_28 = DATECVT((DATEADD((DATECVT (&YYMD, 'I8YYMD', 'YYMD')),'D',  -28)), 'YYMD','I8YYMD');
-SET &DATE_LESS_28 = EDIT(&DATE_LESS_28,'$$$$99/99/') || EDIT(&DATE_LESS_28,'9999');
-DEFAULTS &STARTDATE = &DATE_LESS_28.EVAL
-TYPE &STARTDATE


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1958 | Location: Centennial, CO | Registered: January 31, 2006Reply With QuoteReport This Post
Silver Member
posted Hide Post
I do that -DM commands in INCLUDE and the TYPE command shows the correct value but it's the auto-prompt value that's the issue. It displays the literal variable name and not the value.


WebFOCUS 8

Windows, All Outputs
 
Posts: 45 | Location: Phoenix | Registered: March 01, 2018Reply With QuoteReport This Post
Expert
posted Hide Post
What's the properties of the "Prompt For Parameters" on the fex (Yes or No)?
 
Posts: 3045 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Bear in mind the order of execution: Autoprompt is triggered by a static analysis (pre-scan) of the code, before any lines (whether DM of FOCUS) in the fex are executed. At that point, none of the amper vars have actually been instantiated. In shore, Autoprompt can only assemble prompting text based on the static content of the fex file.

To overcome that you'd have to generate fex code dynamically, in which the computed values are hardcoded in the -DEFAULT statements, and then (after a -RUN) EX or -INCLUDE it (in a manner that gets by the client-side pre-scan). But I'd hestiate to venture out on that limb in a production application.

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] -DEFAULT DYNAMIC VALUES

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