Sign in to follow this  
Followers 0
Garrett19212

Using & with array

6 posts in this topic

for $x = 1 to $idlen2

Dim $Idle & $x [2]

$x = $x + 1

next

I get the error on

Dim $Idle & $x [2]

Share this post


Link to post
Share on other sites



Without being 100% on what you're trying to achieve, are you perhaps wanting this? --

dim $idle, $x[2]

Share this post


Link to post
Share on other sites

Alright no errors, one more quick question.

$idle, $n = $text

I tried using the way you did but turned out as an error.

How can i make $idle$n (for example) = $text

So if $n = 1

I want $idle1 = $text

Hope you understand what I mean.

Share this post


Link to post
Share on other sites

I think you might mean this:

$text = "My text"
$n = 1
assign("idle" & $n, $text)
msgBox(64, "$idle1", $idle1)

Share this post


Link to post
Share on other sites

Ok, got that, but im still confused.

How would i set $idle$x[2] = $i1

Assign($i1, $idle & $x[2])

Sleep(Number($i1)

I get this error

Assign($i1, $idle & $x[2])

Assign(Xi1, $idle & ^ERROR

Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded.

Share this post


Link to post
Share on other sites

If you want to create a variable called $idleZ where Z is the content of $x[2] then try this:

Assign("idle" & $x[2], $i1)

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