Sign in to follow this  
Followers 0
Casablanca

problem with variable

5 posts in this topic

I have a problem with variables so i need a push in the right direction (dont even know if it works this way)

the idea i have is that your pushing a button to get a msgbox with the accurate text in it

the GUI is already made and works perfectly, but when i get to the msgbox i seem to stumble a little

now this doesnt work for me, but you get the general idea what im looking for

$roll = Random(1, 7, 1)
MsgBox(0, "", $$roll)

ive seen alot of other guys using && here and there in those kind of situations, but cant find a helpfile on & :D

i also have a few (5374 to be exact) entrys in this form

$1 = "first entry"
$2 = "second entry"
$3 = "third entry"

please point me to the direction to the &-helpfile or explain to me what im doing wrong

-Cas

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hope this helps

MsgBox(0,"box name", "Your text " & $roll, 2)

The 2 at the end is the amount of seconds the box will display for, so you dont have to click "ok", it's a option so doesn't need to be there if you don't want it.

If you want more variables to display just add

& $var2 like this

MsgBox(0,"box name", "Your text " & $roll & $var2, 2)

Edited by Phaser

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hope this helps

MsgBox(0,"box name", "Your text " & $roll, 2)

The 2 at the end is the amount of seconds the box will display for, so you dont have to click "ok", it's a option so doesn't need to be there if you don't want it.

If you want more variables to display just add

& $var2 like this

MsgBox(0,"box name", "Your text " & $roll & $var2, 2)

Thanks for the fast reply :-)

But this only adds (Your text $roll $var2) on the message for 2 seconds

im trying to use Random() to get me a random entry from the other list

lets say Random(1, 7, 1) becomes 5. then i want it to get the $5 from my entry and return that as the message

Maybe im using the wrong method for this, suggestions ?

Edited by Casablanca

Share this post


Link to post
Share on other sites

You probably want something like this:

$9 = "Use arrays"
$12 = "This is not good."

MsgBox(0, Eval(9), Eval(12))

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

You probably want something like this:

$9 = "Use arrays"
$12 = "This is not good."

MsgBox(0, Eval(9), Eval(12))

Thank you, Eval() solved the problem.

I also noticed why "This is not good.", so I rewrote everything with Arrays and its working fantasticly (and better/easier even).

Over and Out! -Cas

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