Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Parameter Error handling

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Parameter Error handling
 Login/Join
 
Member
posted
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)
 
Posts: 10 | Registered: July 16, 2010Report This Post
Member
posted Hide Post
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
 
Posts: 11 | Registered: November 28, 2011Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Thank you so much it worked !! Smiler


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 10 | Registered: July 16, 2010Report This Post
Expert
posted Hide Post
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!

 
Posts: 6349 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Parameter Error handling

Copyright © 1996-2020 Information Builders