Jump to content
Sign in to follow this  
supahfly

Loop data and execute

Recommended Posts

supahfly

Hi!

I'm not a programmer or something like that. I have read some forums items and the help file but all those thing are hard to understand if it's not your thing...

Maybe someone can help me on the right track.

case scenario;

I have users:

$user1 = "somename1"

$user2 = "somename2"

$user3 = "somename3"

$user4 = "somename4"

$user5 = "somename5"

And one action:

MsgBox(1024,"Hello", $userx)

How can i loop the users in one msgbox?

I hope someone helps me with an answer.

Best Regards,

Share this post


Link to post
Share on other sites
youknowwho4eva

you mean something like

$user[1] = "somename1"

$user[2] = "somename2"

$user[3] = "somename3"

$user[4] = "somename4"

$user[5] = "somename5"

for $i = 1 to 5
MsgBox(1024,"Hello", $user[$i])
next

? or something like

for $i = 1 to 5
if $user[$i] = somename2 then MsgBox(1024,"Hello", $user[$i])
next
?

Giggity

Share this post


Link to post
Share on other sites
supahfly

you mean something like

$user[1] = "somename1"

$user[2] = "somename2"

$user[3] = "somename3"

$user[4] = "somename4"

$user[5] = "somename5"

for $i = 1 to 5
MsgBox(1024,"Hello", $user[$i])
next

? or something like

for $i = 1 to 5
if $user[$i] = somename2 then MsgBox(1024,"Hello", $user[$i])
next
?

Yeah something like that! (your fast :) )

When i try to run i get this error: Subscript used with non-Array variable.:

and points to: $user[1] = "somename1"

any ideas?

Share this post


Link to post
Share on other sites
youknowwho4eva

put

dim $user[100]

at the top.


Giggity

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  

×