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.

DarkBASIC Professional Discussion / Variable '...' does not exist at line ... error

Author
Message
Alaror
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 15th Jun 2011 21:49 Edited at: 15th Jun 2011 21:50
I'm having some problems with a user defined type/array that I've created. When I try to compile the program it says the following: "Variable '&arr_Object_Player_Data' does not exist at line 836."

There are three different sections of code that may relate to this error. Sorry in advance that all the code isn't lined up.

1. Where the error is taking place (code to create the object, using data from another array to set defaults). The error first appears at the line with var_PositionX.




2. Where the user defined type "typ_Object_Player" is defined.




3. Where the data defaults for that type is defined.

Lucas Tiridath
AGK Developer
17
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 15th Jun 2011 22:28
Well that error means that the compiler thinks that the array arr_Object_Player_Data has not been declared. Although line 836 may be what the compiler says, it is often a line or two out and a more likely candidate would seem to be the line above which, from the code you've shown, is the first place that the array is mentioned in the code. Sorry if this is an obvious point but how sure are you that you've declared your array before the first code snippet? Can you show us the code for it?
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 15th Jun 2011 22:55
Usually a typo. Very annoying in DBP which is why I moved back to C++.
With that many vars in your type def you would have to look for a typo. I did have a look but nothing yet... In your case as in many of mine it's upper or lower case...

Warning! May contain Nuts!
Alaror
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 16th Jun 2011 05:29
Well, I feel like an idiot now. You're right Lucas, I had declared only arr_Object_Player_Created and not arr_Object_Player_Data

Login to post a reply

Server time is: 2026-07-11 11:41:41
Your offset time is: 2026-07-11 11:41:41