Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Script line errors

Author
Message
Kazlin
16
Years of Service
User Offline
Joined: 13th Nov 2008
Location:
Posted: 30th Nov 2008 18:34
i have been getting a script line error and i can not see the problem any help would be much apreciated

if cy#>object position y(obj) and creatures(obj).movestate > 0
incline=0
diffx#= cx#-object position x(obj)
diffy#= cy#-object position y(obj)
diffz#= cz#-object position z(obj)

the error i get is Runtime error 118-Array dosn't exist or array subscript out of bounds at line 439
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 30th Nov 2008 19:50
It looks like the variable 'obj' is probably larger than the size of your array. For instance, the array size might be 20, but 'obj' is equal to 30. In this case you're trying to access an element of the array that doesn't exist. This can be fixed by making the array bigger.

Kazlin
16
Years of Service
User Offline
Joined: 13th Nov 2008
Location:
Posted: 30th Nov 2008 20:07
sorry im not getting what your saying im still really new to programing and sorry if it shows im just trying to understand it all is there commands for array because i can not find anything with it in it.
Databug
16
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 1st Dec 2008 05:03
When you declare an array you do something like this:
dim x(20)
so the array only holds up to 20 items but if you call on a slot of an array, such as object position x(obj) obj has to be between 0 and 20. It wont allow anything higher. you cant call the 30th item if youve only created 20 slots.

hope it helps
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 1st Dec 2008 05:51
Databug sorta has it, but we can help more if you post your code. The problem you are getting says one of two things:

-you're not declaring your array using 'dim'
-you're trying to access an element of your array that doesn't exist, in other words the array is too small.

Once again, if you can post your code that'd help a ton.

Kazlin
16
Years of Service
User Offline
Joined: 13th Nov 2008
Location:
Posted: 1st Dec 2008 15:34
i tryed changing the dim around but its still the same problem .



Login to post a reply

Server time is: 2024-11-25 14:27:00
Your offset time is: 2024-11-25 14:27:00