Sign in to follow this  
Followers 0
Hooch

Eval() - help please

6 posts in this topic

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.

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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.

<{POST_SNAPBACK}>

..oh and thanks as well Slim :ph34r:

Share this post


Link to post
Share on other sites

What kind of job did you get fired from? How could they fire you! You're Larry!

Share this post


Link to post
Share on other sites

=/ SOrry to hear that. Their loss.

Share this post


Link to post
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
Sign in to follow this  
Followers 0