Focal Point
[SOLVED] Help needed in debugging WebFOCUS "script" - nested IFDEFs

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

July 08, 2010, 10:05 AM
Francis Mariani
[SOLVED] Help needed in debugging WebFOCUS "script" - nested IFDEFs
This code might be overkill, but I thought it was syntactically correct, but when I put it in site.wfs, it brought down the web server.

Anyone have any ideas on either fixing this or simplifying it?

If IBIMR_user exists - pass it, if IBIC_user exists - pass it, otherwise make IBIC_user equal to IBIMR_user
else
If IBIC_user exists - pass it, if IBIMR_user exists - pass it, otherwise make IBIMR_user equal to IBIC_user
else
Set IBIMR_user to "test" and set IBIC_user to "test".

<IFDEF> IBIMR_user
    <set> IBIMR_user = &IBIMR_user (pass)
        <SENDVAR>
            IBIMR_user_found = 'true 1'
        <ENDSENDVAR>
    <IFDEF> IBIC_user
        <set> IBIC_user = &IBIC_user (pass)
        <SENDVAR>
            IBIC_user_found = 'true 1'
        <ENDSENDVAR>
    <ELSE>
        <SENDVAR>
            IBIC_user = &IBIMR_user
            IBIC_user_found = 'false 1'
        <ENDSENDVAR>
    <ENDIF>
<ELSE>
<IFDEF> IBIC_user
    <set> IBIC_user    = &IBIC_user (pass)
        <SENDVAR>
            IBIC_user_found = 'true 2'
        <ENDSENDVAR>
    <IFDEF> IBIMR_user
        <set> IBIMR_user = &IBIMR_user (pass)
        <SENDVAR>
            IBIMR_user_found = 'true 2'
        <ENDSENDVAR>
    <ELSE>
        <SENDVAR>
            IBIMR_user = &IBIC_user
            IBIMR_user_found = 'false 2'
        <ENDSENDVAR>
    <ENDIF>
<ELSE>
    <SENDVAR>
        IBIC_user = test
        IBIMR_user = test
        IBIC_user_found = 'false 3'
        IBIMR_user_found = 'false 3'
    <ENDSENDVAR>
<ENDIF>

This message has been edited. Last edited by: Francis Mariani,


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
July 15, 2010, 02:26 PM
dlogan
Your code appears to be much more complicated than it needs to be:

<IFDEF> IBIMR_user
  IBIMR_user_found = 'true 1'
  <IFDEF> IBIC_user
    IBIC_user_found = 'true 1'
  <ELSE>
    IBIC_user = &IBIMR_user
    IBIC_user_found = 'false 1'
  <ENDIF>
<ELSE>

<IFDEF> IBIC_user
  IBIC_user_found = 'true 2'
  <IFDEF> IBIMR_user
    IBIMR_user_found = 'true 2'
  <ELSE>
    IBIMR_user = &IBIC_user
    IBIMR_user_found = 'false 2'
  <ENDIF>
<ELSE>
  IBIC_user = test
  IBIMR_user = test
  IBIC_user_found = 'false 3'
  IBIMR_user_found = 'false 3'
<ENDIF>

<SET> IBIMR_user (pass)
<SET> IBIC_user (pass)
<SET> IBIC_user_found (pass)
<SET> IBIMR_user_found (pass)



Try the above which should be much easier to read and does the same thing.

Also, when setting values ' are not needed. The values will actually include the ' marks.


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP


July 15, 2010, 04:25 PM
Francis Mariani
Doug,

Thanks for simplifying the code.


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
July 15, 2010, 05:22 PM
dlogan
I'm glad it worked for you!


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP