Focal Point
Nested IFs

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

August 12, 2013, 03:39 PM
karinC
Nested IFs
Good Afternoon,
Is there a limit of nested IFs within a define? And what is the limit of how many defines we can use in a report?
Thanks in advanced.
Karin
August 12, 2013, 04:14 PM
Prarie
what release are you on.

This is as of 7.6

Is there a limit using nested IF-THEN-ELSE statements?
Solution:
There is no limit on the number of IF-THEN-ELSEs. Previously the limit was 16.
Now the limit is depended upon by the amount of memory available. This also
depends on what is in the IF-THEN-ELSE. For example:
(IF COUNTRY EQ 'ENGLAND' ELSE IF COUNTRY EQ 'FRANCE'

The code above would use less memory then the code below:
IF (COUNTRY EQ 'ENGLAND' AND CAR EQ 'JAGUAR' AND SEATS GT 15
AND etc.... THEN ELSE.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Thank you so much!
Karin
And yes, I am on 7.7 but going to 8.0.

Thank you!
Karin


WebFocus 8
Windows 7
All outputs
KarinC,

The number of IF-THEN-ELSE might not be a problem...

...but we've encountered the problem that the total length of the IF-statement ( in characters ) seems to have a maximum.

Greets,
Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
Dave,

Do you know what's the limit?
Thanks!
Karin
No, sorry. I don't.

But it's not really big.

I think we had trouble with
-IF .... THEN ... ELSE
-IF ... TEHN ... ELSE
etc.

before we made it to 100 lines.


But it's easily avoidable when broken up in smaller parts.

G'luck.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
Dave, are you talking about Dialog Manager -IF/THEN/ELSE statements instead of FOCUS ones?

In dialog manager you can only use those with GOTO labels, or as part of an assignment (-SET &X=IF ... THEN ... ELSE ...).

I doubt you'd run into a situation where you'd have so many labels to choose from that you'd run into a statement length limit (labels are limited to 12 characters even), so I assume you're talking about the usage of IF THEN ELSE in an assignment?


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
As of 7.7, Dialogue Manager Labels can be 64 characters in length.


Alan.
WF 7.705/8.007
karinC, just curious, did you mean to have 2 topics on Nested Ifs?

Anyway, see my answer here:

Nested IFs


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
No, not really. I wanted to put it under another topic and I wasn't sure how I ended up there. Thank you so much for assistance! Smiler
Karin


WebFocus 8
Windows 7
All outputs