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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Multiple conditions in single IF THEN ELSE statement

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Multiple conditions in single IF THEN ELSE statement
 Login/Join
 
Platinum Member
posted
Hello,

I have a HTML launch page for one of my reports and I am having some trouble with it.

There is a checkbox parameter &OPTION1 which is either Yes or No... I am trying to do this and it throws an error saying missing value for &SELECTPROC... what am I doing wrong here?

-SET &SELECTPROC = 'FOC_NONE'; (I used DEFAULT too here, nothing helps - still get same error)

-IF &OPTION1 EQ 'No' THEN GOTO label1;
-IF &OPTION1 EQ 'Yes' AND &SELECTPROC EQ 'ABC' THEN GOTO labelABC ELSE IF &OPTION1 EQ 'Yes' AND &SELECTPROC EQ 'XYZ' THEN GOTO labelXYZ;


Please help! Thanks!

This message has been edited. Last edited by: Nova27,


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
Hi Nova,
What is the error?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Platinum Member
posted Hide Post
missing value for &SELECTPROC


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Member
posted Hide Post
Try adding .EVAL to the end of the parameter?

.. AND &SELECTPROC.EVAL EQ 'ABC'


App Studio 8105; Win 7 x64; HTML, Excel
 
Posts: 8 | Registered: December 14, 2016Report This Post
Expert
posted Hide Post
What is the actual error ?

The code you have posted should set the &SELECTPROC variable

Can you post more of the code ?

Also have you turned on &ECHO=ALL to see what the flow of the program is ?, it may give insights


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: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Guys!

no matter what HTML passes.

If you use -SET it will be overwritten.
So in this case &SELECTPROC will always be 'FOC_NONE'.

The error you get. Is that actually related to these lines?



And you should use -DEFAULTH to set add a value to a parameter when it's not supplies by an HTML.

And the proper syntax would be _FOC_NONE (underscroe in the beginning )


Greets,
Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Expert
posted Hide Post
quote:
And the proper syntax would be _FOC_NONE (underscroe in the beginning )

Sorry Dave, that is not true for FOC_NONE. There is no leading underscore.

Nova, and other newbies,

FOC_NONE is nearly the oldest form of "ignore selection" for an amper variable that there is.

"$*" used to be used for "anything in the first character position and ignore the rest" but it didn't help when selecting against single character strings - hence FOC_NONE was introduced.

The way in which FOC_NONE worked was to basically ignore the line and remove it from the execution stack. It would still get parsed (and prompted if autoprompting turned on and not -SET) and can cause errors like the one Nova is experiencing.

In later years "_FOC_NULL" was introduced to help in this situation and, of course, FOC_NONE had to remain available for backward compatibility (Wink).

What you can do is use the amper variable "operators" like .EVAL, but .EVAL will not work in this instance.

However, .QUOTEDSTRING will

T

-SET &OPTION1 = 'Yes';
-SET &SELECTPROC = 'FOC_NONE';

-IF &OPTION1 EQ 'No' THEN GOTO label1;
-IF &OPTION1 EQ 'Yes' AND &SELECTPROC.QUOTEDSTRING EQ 'ABC' THEN GOTO labelABC ELSE IF &OPTION1 EQ 'Yes' AND &SELECTPROC.QUOTEDSTRING EQ 'XYZ' THEN GOTO labelXYZ;



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
No luck with trying all your suggestions Frowner
I still get the same error: A VALUE IS MISSING FOR &SELECTPROC..

Here's my code:
-DEFAULTH &DEBITPROC = '_FOC_NULL';
........
..........
TABLE FILE ABCD
PRINT
TEXT1 OVER
TEXT2 OVER
-IF &OPTION1 EQ 'No' THEN GOTO :NODEBITPROC ELSE GOTO :RESOLVEDEBITINFO;

-:RESOLVEDEBITINFO
-IF &OPTION1 EQ 'Yes' AND &SELECTPROC.EVAL EQ 'CTP' THEN GOTO :CTP ELSE IF &OPTION1 EQ 'Yes' AND &SELECTPROC.EVAL EQ 'Everlink' THEN GOTO :Everlink;

-:NODEBITPROC
TEXT3 OVER
TEXT4 OVER
TEXT5
-GOTO :COMPLETE

-:CTP
......
.....
-GOTO :COMPLETE

-:Everlink
........
.......
-GOTO :COMPLETE

-:COMPLETE
.......
WHERE ...........
ON TABLE PCHOLD FORMAT PDF
.........
END


Basically I have a checkbox on my HTML page which passes Yes or No value to &OPTION1.. If it No then I don't do anything special, just carry on with my report... If it is Yes, then depending on what is the value for &SELECTPROC, I have to print address for either CTP or Everlink .... and that is what I am trying to achieve in this part of my report...

P.S.: there is a lot of other logic going on in the report, but this is the only place where I use these parameters..

Please advise! Thanks!


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Platinum Member
posted Hide Post
quote:
DEFAULTH &DEBITPROC = '_FOC_NULL';


Sorry this is
-DEFAULTH &SELECTPROC = '_FOC_NULL';


I have also tried using SET in place of DEFAULTH.. no luck

I have also tried everything with FOC_NONE.. same error each time.. Frowner


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Platinum Member
posted Hide Post
Also, "A VALUE IS MISSING FOR &SELECTPROC" comes up even though I select No in the OPTION1 checkbox on the HTML page...


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
Add -SET &ECHO=ALL; to the very beginning of your code, so you can see what's being substituted in the variables. If it's saying value is missing for your variable, you'll know why, when you look at the code after all the -SETs and -DEFAULTs have been resolved and you'll get a better idea of where you're having problems.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
Thanks BabakNYC..

That's exactly what I tried doing... I used -TYPE statement at the very beginning too, to see what's being passed to these variables through the HTML page, but it just doesn't show up...

so I have my SET or DEFAULTH statement and after that I have -TYPE to see the values, but it doesn't show up when the fex runs.. only shows the error for missing value...

also, I have a SQL query which runs and stores the results on a HOLD file before I have this -IF ELSE statement logic, the query runs because I see the file format in the output followed by the MISSING VALUE FOR &SELECTPROC error...


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Platinum Member
posted Hide Post
Something strange...

I just tried running the fex as a stand-alone(supplied values for parameters when the fex procedure auto-prompted for them) as opposed to supplying values through the HTML page; and the report runs fine... results are as expected ...

I am not sure why the -DEFAULTH &SELECTPROC = '_FOC_NULL'; does not work with HTML, but works when I run the fex as a stand-alone Frowner


P.S.: I had tried turning off the auto-prompting feature for the fex while running it through the HTML page, didn't work.. Turned it on too and it still didn't work...


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
My advice -- Whenever you get "A VALUE IS MISSING FOR &xxxxx", check very carefully for misspellings and missing semicolons.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
Finally I realized what was going on!

WebFocus works in such a peculiar way!!!! Uuuuggghhhhh!!! I had to make sure that I had ALL my SETs or DEFAULTS for the amper variables typed out in my fex before building a HTML page for the report. If I made any changes (like, introducing a new DEFAULTH statement in my fex) then the HTML composer does not comprehend it correctly and wouldn't pass the right value.

So I had to create my HTML page from scratch (after making sure my fex was ready with everything I wanted), then import my fex into the HTML page, link my parameters and I am now good to go.... PHEW!!!!!

I have noticed this during my short time with WF - when you are attempting to build GUIs for your fex, the order in which you carry out each task is most important, because if you forget something or change the order of things, your report just won't work Frowner Frowner

I hope this is true only for this version and has been resolved in newer versions.

Thanks everyone for your help!


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
When you make changes to a REFERENCEd report, you can refresh the parameters in Composer, so it knows you've made changes. You don't have to recreate it from scratch.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report 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] Multiple conditions in single IF THEN ELSE statement

Copyright © 1996-2020 Information Builders