Jump to content

Eval() - help please


Hooch
 Share

Recommended Posts

Ok so I have searched and read some threads but I am not grasping this, is it true that you can't do this...

$HOTBAR_VALUE = Eval("$CUSTOM_HOTBAR_" & $CMD_CUSTOM)

...so in this instance $CMD_CUSTOM is present and is equal to 1 so the variable I am trying to access is $CUSTOM_HOTBAR_1 but I am not getting anything.

Link to comment
Share on other sites

Lose the dollar sign in the eval function.

Here's a script you can study:

$CUSTOM_HOTBAR_1 = 50
$CUSTOM_HOTBAR_2 = 100

$CMD_CUSTOM = 1
$HOTBAR_VALUE = Eval("CUSTOM_HOTBAR_" & $CMD_CUSTOM)

MsgBox(0, "Test", "$HOTBAR_VALUE: " & $HOTBAR_VALUE)

$CMD_CUSTOM = 2
$HOTBAR_VALUE = Eval("CUSTOM_HOTBAR_" & $CMD_CUSTOM)

MsgBox(0, "Test", "$HOTBAR_VALUE: " & $HOTBAR_VALUE)
Link to comment
Share on other sites

The example in the help file would inform you that...

$HOTBAR_VALUE = Eval("CUSTOM_HOTBAR_" & $CMD_CUSTOM)
is correct

<{POST_SNAPBACK}>

A little condesending there Larry but thanks, I missed that detail when I was looking at the example, and yes I did look at it.

It might help, to add that as a note to the help file that you have to omit the $ for those as unobservant as me.

Edited by Hooch
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...