Focal Point
[SOLVED] if ...goto

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

August 04, 2010, 01:54 PM
swati
[SOLVED] if ...goto
HI ALL,
NEED HELP on If ....GOTO.

i have two if statements as:

-IF &XYZ EQ 0 THEN GOTO NOdata ELSE GOTO Data ;
and another similar If stmt is
-IF &ABC EQ 0 THEN GOTO NOdata ELSE GOTO Data ;

i need help on how to tie these above two statements.i mean how to use both &ABC and &XYZ in a single if stmt.

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


7.6.7
windows
PDF,EXCEL.
August 04, 2010, 02:16 PM
Prarie
OR
August 04, 2010, 02:19 PM
swati
Hi PRARIE,
can i use 'or' like this in IF stmt.


-IF (&ABC or &XYZ) EQ 0 THEN GOTO NOdata ELSE GOTO Data ;

please let me know.


7.6.7
windows
PDF,EXCEL.
August 04, 2010, 02:39 PM
Arif
OR is capital O and R.

Why are you not trying
IF
ELSEIF
ELSE


WebFOCUS 7.6.10
Windows
HTML
August 04, 2010, 04:19 PM
Francis Mariani
This is an OR statement that works similarly for any programming language:

-IF &XYZ EQ 0 OR &ABC EQ 0 GOTO NOdata ELSE GOTO Data;

or
-IF &XYZ EQ 0 GOTO NOdata ELSE 
- IF &ABC EQ 0 GOTO NOdata ELSE GOTO Data;



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
August 04, 2010, 05:45 PM
Waz
I would always suggest using parentheses, as this forces the order of evaluation.
-IF (&XYZ EQ 0) OR (&ABC EQ 0) GOTO NOdata ELSE GOTO Data;



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!

August 05, 2010, 09:45 AM
Hua
swati, the IF structure seemed simple enough. If you still have trouble going where you want to go, try -SET &ECHO = ALL to see how DM interpret you IF statement. You will be suprised that...
FOC_NONE <> 'FOC_NONE'
'ABC' <> 'ABC ' or ABC <> 'ABC'
null string <> blanks

Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
August 05, 2010, 11:06 AM
swati
thanks all.


7.6.7
windows
PDF,EXCEL.
August 13, 2010, 03:41 PM
Enigma006
IF and ELSE IF is safe than OR in some cases

thanks


8.1.05
HTML,PDF,EXL2K, Active, All