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] Using Variable as a LABEL value in loop ((FOC305) SPECIFIED LABEL NOT FOUND)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Using Variable as a LABEL value in loop ((FOC305) SPECIFIED LABEL NOT FOUND)
 Login/Join
 
Member
posted
Hi

I'm trying to put a variable value as a LABEL name which is being used in a loop. Somehow I'm getting the error : "(FOC305) SPECIFIED LABEL NOT FOUND". &cnt is assigned before this piece of code executes. All works fine until the loop needs to break out on the count of 9.

 
-SET &LOOP_VAR='LOOP2' || &cnt;
-TYPE &LOOP_VAR
-REPEAT :_&LOOP_VAR.EVAL WHILE &I LT 9;
-* ======================================================================
-* do something
-* =======================================================================
-:_&LOOP_VAR.EVAL 

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


WebFOCUS 7.6.1
Windows, HTML,PDF,EXCEL2000
 
Posts: 21 | Registered: November 27, 2013Report This Post
Virtuoso
posted Hide Post
You cannot do that; and you have no need to. Make the label a simple constant, both in the target line and in the earlier reference within the GOTO or REPEAT directive. &I varies; the label does not.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Member
posted Hide Post
I understand that this is not required in normal day scenario. My specific requirement bounds me to include a common module multiple times in the same report code. This loop is present in the common module.
Now, when this loop is called the second time, same label name is causing name conflict. Hence, the usage of "&cnt".


WebFOCUS 7.6.1
Windows, HTML,PDF,EXCEL2000
 
Posts: 21 | Registered: November 27, 2013Report This Post
Virtuoso
posted Hide Post
Pradhan,
I tried your idea without using a variable for the loop. Here are 2 fexes: LCALL and LVAR.
  
-SET &ECHO=ALL;
-*LCALL
-SET &K=1;
-INCLUDE LVAR
-SET &K=2;
-INCLUDE LVAR

  
-*LVAR
-REPEAT #LOOP_VAR FOR &I FROM 1 TO &K;
-* ======================
-TYPE do something
-* =======================
-#LOOP_VAR

This works for me.
My assumption is that either:
1. as long as you branch forward you can have identical labels
2. labels are local to the included fex


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
Virtuoso
posted Hide Post
quote:
2. labels are local to the included fex


That's certainly true for -GOTO

-- the target label of a GOTO in an -INCLUDE MUST be in the same file; and then the same file can be included multiple times. Just have to make sure the label does not conflict with those that appear in the enclosing file.

Same should apply to -REPEAT.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Member
posted Hide Post
Danny and J,

I agree that holds for GOTO. But somehow I find that including the same fex multiple times in a blank test file doesn't run into problems.
It probably halts when the label name conflicts with labels in other included fex. Still a gray area why it's happening. Meanwhile, I've just updated the name of the label in the included file to something ridiculous which might not be used anywhere else...

Thanks for your response though!


WebFOCUS 7.6.1
Windows, HTML,PDF,EXCEL2000
 
Posts: 21 | Registered: November 27, 2013Report 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] Using Variable as a LABEL value in loop ((FOC305) SPECIFIED LABEL NOT FOUND)

Copyright © 1996-2020 Information Builders