AnsweredAssumed Answered

Global Variables on the fly?

Question asked by deltatango on Dec 28, 2009
Latest reply on Dec 29, 2009 by deltatango

Title

Global Variables on the fly?

Post

In PHP it is possible to reference variables "variably", e.g.:

 

$files = array('dog','cat','pig');

$cars = array('bmw','toyota','masda');

 $currentArray = 'files';

echo $$currentArray[0]; //will print dog

 

Is there a way to do this in FM?

 

I have a table called settings. There are 3 columns: setting_id, setting_name, setting_value. What I want to do is create a script that will, upon opening the file, run through each record in this table and create a global variable with the setting_name column.

 

So once again, to recapitulate, If the field setting_name says "maxUsers", I want to create a script step that will make a global variable called maxUsers and set it to what the setting_value column says. 

 

Thanks 

Outcomes