Hi all, I have a text box (Html composer) that takes a number and passes it to a procedure. When I type a number it works fine. However, when there is no number (blank field) it fails to generate the report. Here is the code I used to check for 0 or null value in the .fex
-IF ('&XFIELD' EQ '' OR 0 OR NULL) THEN GOTO XFIELD; WHERE (FIELDA EQ '&XFIELD'); -XFIELD
Please note the Field in the DB I am verifying against is Number(7)
Please advise.This message has been edited. Last edited by: Kerry,
WebFOCUS 7.6.8 Windows Excel, HTML
March 08, 2010, 03:13 PM
Francis Mariani
Do you get an error message?
I would code the IF statement slightly differently:
HINT: Always use a DEFAULT for variable which may / may not be present. Actually, why not always use a DEFAULT for a variable? It makes easy testing and HTML Composing... I do something like
-DEFAULT &MyVar = '*' ;
-SET &MyVar = IF &MyVar EQ '*' THEN This ELSE That ;
... Continue with code
However, if your variable is coming in for the composer (Launch Page) then why not pass in a FOC_NONE? Then there's no need for branching...
In FOCUS Since 1983 ~ from FOCUS to WebFOCUS. Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
TABLE FILE ZZZ
PRINT
...
WHERE FIELDA EQ &XFIELD;
END
Make sure to place the WHERE statement that checks for &XFIELD in a separate line,without mixing with other conditions. When FOC_NONE is passed, WebFOCUS Server's 'Describe' layer will remove the entire line.