Focal Point
Check presence of an amper variable
December 22, 2005, 01:19 PM
Govind JujareCheck presence of an amper variable
Is there a way to find out if an amper variable has been passed ? I tried '&EMP_NAME.EXIST' and it seems to be checking for the presence of the value. I am interested in presence of the variable itself.
WebFOCUS 5.3.3 MRE - Solaris - Sun Web Server - Weblogic
December 22, 2005, 01:57 PM
Francis MarianiUncomment the first line of the following code to see the behaviour when &APPLE exists.
-*-SET &APPLE = 'RED';
-IF &APPLE.EXISTS NE 1 GOTO APPLE_NO;
-TYPE APPLE EXISTS
-GOTO END1
-APPLE_NO
-TYPE APPLE DOES NOT EXIST
-END1
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
December 22, 2005, 02:10 PM
Govind JujarePerhaps I should rephrase. If the line is uncommented, it prints "APPLE EXISTS". If commented, it prompts the user for value of APPLE (here I want it to print "APPLE DOES NOT EXIST" instead of prompting the user). Thx.
WebFOCUS 5.3.3 MRE - Solaris - Sun Web Server - Weblogic
December 22, 2005, 02:18 PM
Francis MarianiThe behaviour you describe is probably happening in a fex in MRE. My example worked without any prompt as a stand-alone fex.
In MRE, right-click on the fex, select Properties and uncheck "Prompt for parameters".
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
December 22, 2005, 06:13 PM
Govind JujareThat worked good. Thanks a lot. It would be nice if I could do "no prompting" only for one selected variable. But, for now, your method is good for me. I will use it.
WebFOCUS 5.3.3 MRE - Solaris - Sun Web Server - Weblogic
December 23, 2005, 08:19 AM
mgrackinGovind,
Try adding a -DEFAULT at the beginning of your program for the variable for which you do not want to get prompted. If calling the report request does not supply a value for the variable it should use the -DEFAULT value and not prompt for it.
-DEFAULT &VAR1 = thevalue;
Thanks!
Mickey
| FOCUS/WebFOCUS 1990 - 2011 |
December 23, 2005, 11:29 AM
Francis MarianiThat is the very sensible solution.
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
December 23, 2005, 12:17 PM
Govind JujareWhen I used the "DEFAULT", the procedure still throws an input screen at the user (now that the value is prepopulated, the user just needs to click "submit"). This is good. But this is slightly different from what I want.
I have a procedure that gets called through an URL. If that URL is missing an amper variable completely, I dont want to throw an input screen. I want to be able to detect it in the procedure (that it is missing) and take predefined action. I used Francis's way of "Uncheck the 'Prompt for parameters' property of the procedure".
Thx
WebFOCUS 5.3.3 MRE - Solaris - Sun Web Server - Weblogic