Jump to content

Can you combine "text" + a variable to a new variable name?


Recommended Posts

I havent found a solution for this issue so far, but I really wonder if this is possible somehow.

$counter = 0
$var_1 = "something"
$var_2 = "something else"

While 1 = 1
$counter = $counter + 1

MsgBox(1, ""var_" & $counter", ""var_" &counter"

WEnd

Any ideas or help will be appreciated.

Link to comment
Share on other sites

You can very likely do what you want to do using Arrays.

Dim $strings[5]
$Strings[0] = "Message 1"
$Strings[1] = "Message 2"
$Strings[2] = "Message 3"
$Strings[3] = "Message 4"
$Strings[4] = "Message 5"

For $i = 0 to 5
Msgbox(0,$Strings[$i], $Strings[$i])
Next
Edited by Paulie
Link to comment
Share on other sites

I havent found a solution for this issue so far, but I really wonder if this is possible somehow.

$counter = 0
$var_1 = "something"
$var_2 = "something else"

While 1 = 1
$counter = $counter + 1

MsgBox(1, ""var_" & $counter", ""var_" &counter"

WEnd

Any ideas or help will be appreciated.

have you tried swimming?

$counter = 0
$var_1 = "something"
$var_2 = "something else"

While 1 = 1
$counter = $counter + 1

MsgBox(1, $var_1 & " is " & $counter, var_2 & " is " & $counter)

WEnd

like this:

$value & "text"

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

have you tried swimming?

$counter = 0
$var_1 = "something"
$var_2 = "something else"

While 1 = 1
$counter = $counter + 1

MsgBox(1, $var_1 & " is " & $counter, var_2 & " is " & $counter)

WEnd

like this:

$value & "text"

Not what he was asking. He wanted to reference Var1 and Var2 with a counter
Link to comment
Share on other sites

OR you could try useing timerinit() and timerdiff() maybe thats not what you want but you could try

Link to comment
Share on other sites

I havent found a solution for this issue so far, but I really wonder if this is possible somehow.

$counter = 0
$var_1 = "something"
$var_2 = "something else"

While 1 = 1
$counter = $counter + 1

MsgBox(1, ""var_" & $counter", ""var_" &counter"

WEnd

Any ideas or help will be appreciated.

This appears to work.

Local $counter = 0
Local $var_0
Local $var_1 = "something"
Local $var_2 = "something else"

Assign("var_" & $counter, Eval("var_" & $counter + 2) & " Extra")

While $counter <> 3
    MsgBox(1, "var_" & $counter, "var_" & $counter & " = " & Eval("var_" & $counter))
    $counter = $counter + 1

WEnd

Edit: Added Assign() Function which was mentioned in an earlier post.

It adds to the possibilities of variables manipulation.

Edited by Malkey
Link to comment
Share on other sites

ok if your looking for a time func what i said would work lol what ever you need

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...