Home General

Exstream 16.6.0 Dynamic variable fill

Apologies for the title, wasn't really sure how to describe this in one line.

Wondering if there is a way to assign values to variables based on a string value. For example, in the function below I have two arrays FooterName and FooterText. I have variables whose names match up to what is provided by the FooterName array variable. If I have a value of "FooterA" in the FooterName array I would like the variable named FooterA in the application to be assigned the value from the corresponding FooterText value.

The FooterName and FooterText array variables are filled from the XML file.

Of course the function would not work as is. I looked through the documentation to try to find something that would allow me to reference the target variable, something like OBJECT(FooterName(x)) or VARIABLE(FooterName(x)) but did find anything that would be useful.

Any help would be appreciated.

Thank you

Integer x, y

//Get the count of footers in the FooterName array

y = Count(FooterName)

x = 1

FOR x = 1 to y

//Assign the footer text value to the variable represented by the FooterName value

FooterName(x) = FooterText(x)

NEXT x

Sign In or Register to comment.