Post new topic Reply to topic  [ 3 posts ] 

Board index : TeleFlow Forums : TeleFlow Designer & Simulator

Author Message
 Post subject: Dynamically creating numbered variable names
PostPosted: Mon Dec 17, 2007 3:19 pm 
Offline
User avatar

Joined: Fri Feb 06, 2004 11:05 am
Posts: 115
Location: Costa Rica
I'm developing an application that dynamically loads several configuration parameters in order to evaluate incoming requests.

I need to program a simple cycle that uses an Index (@IDX, numeric). In each iteration I need to use an XML Fetch to obtain the next info:

Handle: --
Node: CONFIG->PROD@IDX
To: @GBL_PROD@IDX

In the node the interpreter will substitute the @IDX value and it will try to get CONFIG->PROD1; this works just fine.

But, how can I use the same @IDX value in the target variable specified in To:, so as to dynamically create the variable @GBL_PROD1 with the value of CONFIG->PROD1?

The idea is to be able to create up to <n> variables this way.

Thanks in advance.


Back to top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 18, 2007 12:08 pm 
Offline

Joined: Wed Mar 19, 2003 4:28 pm
Posts: 510
Location: Canada
Dynamically creating variables isn't possible in TeleFlow (or, if you find a place you CAN do it, it would be an unexpected side-effect of how a step works), and even if you could, no steps could reference your variables, because you can't reference a variable name using a variable or variables.

The trick I can recommend (that could provide something close to what you are looking for, I believe) is to create what is effectively a pseudo-array(not a true array, as TeleFlow doesn't have arrays) using a single variable. Each time you fetch a result, append it to the existing variable, but with a comma or other delimiter character, such as a tilde(~), between each result value.

Then, whenever you wish to reference one of the elements of your array, follow the instructions for arrays in the TeleFlow Help:
1 - Develop Applications with TeleFlow Designer >> Variables >> Arrays


Back to top
 Profile WWW 
 
 Post subject: Thanks!
PostPosted: Tue Dec 18, 2007 4:00 pm 
Offline
User avatar

Joined: Fri Feb 06, 2004 11:05 am
Posts: 115
Location: Costa Rica
Geez! Nice aproach :D I'll give it a try, thanks.


Back to top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

Board index : TeleFlow Forums : TeleFlow Designer & Simulator


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Style by Midnight Phoenix & N.Design Studio
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.