Jump to content

Is it possible to combine 2 variable names to create a new variable?


 Share

Recommended Posts

Hey guys,

Here is what I am trying to do:

$var1 = "red"
$var2 = "green"
$var3 = "apple"

$var1 & $var3 = "YES"
$var2 & $var3 = "NO"

MsgBox(0, "Is it red?", $redapple)
MsgBox(0, "Is it green?", $greenapple)

My code above does NOT work. But it shows you what I am trying to accomplish.

Basically, I want to create the variables $redapple and $greenapple by combining $var1 with $var3, and $var2 with $var3

Is this possible?

Edited by lemony
Link to comment
Share on other sites

It's funny. I search the forum and help file for hours and don't find anything that helps.

But right after I start the topic I do one more search and boom, the answer is there. LOL.

So for anyone else that may come across this topic, Assign() is the answer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...