Focal Point
[SOLVED] Parameter Error handling

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

May 21, 2013, 05:46 AM
Pri
[SOLVED] Parameter Error handling
Hi,

I am working on display of customized error handling for the foc errors. I am able to handle the errors that populates with respect fields or no data senarios.
But i am not able to display a custoimized message for " (FOC295) A VALUE IS MISSING FOR: &SEATS". Could someone help me with this

Example:
-*-SET &SEATS= 2;
-SET &ECHO = ALL;

TABLE FILE CAR
PRINT
COUNTRY
CAR
WHERE SEATS EQ &SEATS
END

-IF &FOCERRNUM NE 0 THEN GOTO LBL_NODATA ELSE GOTO CONT;

-LBL_NODATA
-INCLUDE ERROR_PAGE
-CONT
-EXIT

I am un able to display the cutomized error message for missing parameter value.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
May 21, 2013, 11:01 AM
ebaig
There are probably more elegant ways of doing this, but you could try something like:

-DEFAULT &SEATS = '';
...
-IF &SEATS EQ ''  THEN GOTO NO_SEATS ELSE GOTO GOT_SEATS;
-NO_SEATS
-TYPE Seats are missing
-EXIT
-GOT_SEATS;
...


Erfan


WebFOCUS 77, Windows, HTML PDF EXCEL
May 21, 2013, 12:02 PM
Francis Mariani
You can also test for the existence of the variable:

-IF &VAR1.EXISTS EQ 0 GOTO ERR1 ELSE GOTO GOOD;

quote:
.EXIST tests for the presence of a value. If a value is not present, a zero (0) is passed to the expression. Otherwise, a non-zero value is passed.



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 21, 2013, 01:43 PM
Pri
Thank you so much it worked !! Smiler


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
May 21, 2013, 05:47 PM
Waz
Pri, I would strongly suggest that you use -RUN before any test of &FOCERRNUM. This is because of the order of evaulation of Dialog Manager and FOCUS code.


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!