August 12, 2013, 03:39 PM
karinCNested 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
Prariewhat 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 |
August 12, 2013, 04:26 PM
karinCThank you so much!
Karin
August 12, 2013, 04:27 PM
karinCAnd yes, I am on 7.7 but going to 8.0.
Thank you!
Karin
WebFocus 8
Windows 7
All outputs
August 13, 2013, 02:08 AM
DaveKarinC,
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
August 13, 2013, 08:52 AM
karinCDave,
Do you know what's the limit?
Thanks!
Karin
August 14, 2013, 02:40 AM
DaveNo, 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
August 14, 2013, 03:44 AM
Wep5622Dave, 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 :
August 14, 2013, 06:44 AM
Alan BAs of 7.7, Dialogue Manager Labels can be 64 characters in length.
Alan.
WF 7.705/8.007
August 15, 2013, 10:12 AM
jgelonakarinC, 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.
August 15, 2013, 10:24 AM
karinCNo, 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!
Karin
WebFocus 8
Windows 7
All outputs