Sign in to follow this  
Followers 0
mrbig1479

What am i doing wrong here

3 posts in this topic

hey i have the following script

Global $data1=45
Global $data2=400
Global $PRICE[$data1][$data2][3]

now i do all kind of staff in the script and in the end i want to do something like this
Global $PRICE[$data1][$data2][0] = $whatever0
Global $PRICE[$data1][$data2][1] = $whatever1
Global $PRICE[$data1][$data2][2] = $whatever2

but i get this error

Subscript used with non-Array variable.:

an i missing something here?

thanks

Share this post


Link to post
Share on other sites



Global $Array[3]

creates an array as...

$Array[0]

$Array[1]

$Array[2]

so...

$Array[3] is out of bounds...


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

In other words your array can't have 45 and 400 as the numbers, you'll have to do $data1 - 1 and $data2 - 1

Global $PRICE[$data1-1][$data2-1][0] = $whatever0
Global $PRICE[$data1-1][$data2-1][1] = $whatever1
Global $PRICE[$data1-1][$data2-1][2] = $whatever2

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