Sign in to follow this  
Followers 0
Garrett19212

Making an array.

3 posts in this topic

$Dim $s[13]

Doesn't seem to be working right.

Errors out here.

For $i = 0 to 13
$s[$i] = ""
Next

Array Variable has incorrect number of subscripts or subscript dimension range exceeded.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

A 13-element array has indexes 0 to 12:

Local $D[13]
For $I = 0 to 12
    $D[$I] = ''
Next

Edit: Using UBound() will ensure that you never receive such an error:

Local $D[13]
For $I = 0 to UBound($D) - 1
    $D[$I] = ''
Next

Edit: This shouldn't be necessary anyway as all variables appear to be initialised to an empty string (for the beta at least):

Local $Array[1]
MsgBox(0x40, 'IsString()', IsString($Array[0]))
Edited by LxP

Share this post


Link to post
Share on other sites

Thanks.

Works.

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