We are passing some parameters into an external module such as:
{myVar = mNav}
In the external module we make bm = to myVar
local bm = params.myVar
Now bm = mNav
We use mNav as a variable to do stuff within the module, but we would also like to have a string version “mNav” so we can call functions such as funcbm. We can’t call this unless the value of bm is defined within speech marks such as “mNav”
Is there an easy way to turn the name of bm into a string e.g. mNav into “mNav”?
perhaps if you showed a bit more complete code it would be easier for me to understand. as your code is above there’s no reason you couldn’t just do bm = “mNav”
Thanks for taking a look. It doesn’t sound like you can easily take a variable name and convert it to a string with parentheses. So we will try it another way.
But looking at this particular problem, imagine you have an external list of names without parentheses around each one. How can you read this list in and use each one to call a function with the same name. ie - a list like
peter
paul
mary
david
eddie
Now we want to iterate through to number 3 and use an entry to call the function
@renato is correct. what i’m trying to do is help you recode it so it will do what you need but without you showing some complete code its hard to do. it doesn’t have to be the code to your app if you don’t want to share just something short and similar so we can see how you are doing the code and show you how to recode for it to work. also include your code inside “[“code”]” “[”/code"]" tags leaving off the " so it can be formatted for easier reading
Yeah but the list we are drawing from is not formatted that way. It is an external file with a list containing entries without parentheses. So we want to use “mary” but our list has mary instead. We can’t change the way the list has been formatted without manually adding parentheses to each of the hundreds of entries… That is why we wondered if there was a way to convert mary into “mary”.