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] dynamic GOTO

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] dynamic GOTO
 Login/Join
 
Gold member
posted
Hi

have anybody made a trick for situation when you have many occurrences of same code and like to put them into one separate fex and use -INCLUDE?

I know that many of us had this Smiler

But how to solve situation if inside of this "replicated" code you have -GOTO label sentence.

I have tried to do something like

Main code:

-SET &I=1
-INCLUDE FUNCTION_AA
... some code of main program ...
-SET &I=2
-INCLUDE FUNCTION_AA

and then

-* FUNCTION_AA

-IF &ASA EQ 'Y' THEN GOTO label&I.EVAL;
... code...code...
-label&I.EVAL


But WF do not see where is label1 or label2 when it comes to GOTO sentence.

Any trick to solve this?

This message has been edited. Last edited by: <Kathryn Henning>,


Wf7704/WF8,Win64/32
 
Posts: 68 | Registered: February 20, 2004Report This Post
Expert
posted Hide Post
Maybe this is a solution:

-DEFAULT &I = '1';

-GOTO LABEL&I.EVAL

-LABEL1
-TYPE LABEL1
-GOTO LABEL_END

-LABEL2
-TYPE LABEL2
-GOTO LABEL_END

-LABEL3
-TYPE LABEL3
-GOTO LABEL_END

-LABEL_END


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
DO you mean (or I have found a trick Smiler ) that in my procedure (repeatable text ) if I know number of use then I should mention all labels like that


-IF &ASA EQ 'Y' THEN GOTO label&I.EVAL;
... code...code...
-label1
-label2
-label3
-label4
...


interesting and I am thinking that may be usable


Wf7704/WF8,Win64/32
 
Posts: 68 | Registered: February 20, 2004Report This Post
Expert
posted Hide Post
Yes, add all the possible labels because I don't think you can have a parameterised label.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Piter,
As far as I know, when you -INCLUDE as fex all labels are at first treated as local, meaning that WF will search the -INCLUDEd fex for labels. If a label is not found, then it will look in the calling fex.
See the following example.
The calling fex:
  
-SET &ECHO=ALL;
-* File piter01.fex
TABLE FILE CAR
PRINT COUNTRY
ON TABLE HOLD AS PITER FORMAT ALPHA
END
-RUN
-SET &R=&LINES;
-REPEAT #GETCOUNTRY FOR &I FROM 1 TO &R;
-READFILE PITER
-INCLUDE PITER00
-#GETCOUNTRY
-TYPE DONE


The -INCLUDEd fex:
  
-* File piter0.fex
-GOTO #PITER0
-#PITER00
-TYPE Back &I
-GOTO #OUT
-#PITER0
-TYPE I=&I COUNTRY=&COUNTRY
-GOTO #PITER00
-#OUT

Try it!


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
Gold member
posted Hide Post
thanks, Daniel. Your case is clear. I was asking about dynamic labels and seems it is also clear - like Francis wrote - WF do not do "precompile" and will not understand 'future' dynamic labels


Wf7704/WF8,Win64/32
 
Posts: 68 | Registered: February 20, 2004Report 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] dynamic GOTO

Copyright © 1996-2020 Information Builders