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] Dynamically named variables.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Dynamically named variables.
 Login/Join
 
Member
posted
Is there a way to create a variable with the name of the variable contained in a second variable?

For example
-SET &VARNAME='DBASENAME';
-SET &'&VARNAME'='ThisName';

-? & would get the following
&VARNAME = DBASENAME
&DBASENAME = ThisName

This message has been edited. Last edited by: Michael2001,


WebFOCUS 8.1.04
Data Migrator
Excel, PDF, HTML, Active Technologies
Windows 7
 
Posts: 5 | Registered: December 23, 2013Report This Post
Virtuoso
posted Hide Post
Michael2001,

The following works, but there is an issue with WF auto-prompting for the variable unless you first -DEFAULTH it up top:

-SET &ECHO = 'ALL';

-DEFAULTH &DBASENAME = '';

-SET &VARNAME = 'DBASENAME';
-SET &VARNAME2 = '&' | '&VARNAME.EVAL';
-SET &VARNAME2.EVAL = 'Tadaa!';
-TYPE &VARNAME &VARNAME2 &DBASENAME


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Virtuoso
posted Hide Post
Try this:
  
-SET &VAR=DB;
-SET &.&VAR=MICHAEL;
-TYPE &VAR
-TYPE &.&VAR


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
Master
posted Hide Post
As . can be used to concatenate names to a single parameter:

-SET &IDX = 0;
-LOOP
-SET &IDX = &IDX + 1;
-SET &PARAM.&IDX = &IDX * 5;
-IF &IDX LT 5 THEN GOTO LOOP;

-TYPE &PARAM1
-TYPE &PARAM2
-TYPE &PARAM3
-TYPE &PARAM4
-TYPE &PARAM5


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Member
posted Hide Post
That worked thanks.


WebFOCUS 8.1.04
Data Migrator
Excel, PDF, HTML, Active Technologies
Windows 7
 
Posts: 5 | Registered: December 23, 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] Dynamically named variables.

Copyright © 1996-2020 Information Builders