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 / Declaration name 'XYZ' is not valid at line Y.

Author
Message
enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 17th Jan 2011 22:01 Edited at: 17th Jan 2011 22:03
I get this error when trying to compile:
Quote: "Declaration name 'SYS_DisplayMode()' is not valid at line 68."


This line is highlighted: (which isn't line 68):
Quote: "global SYS_FrameTimer as SYS_FRAMETIMER_INFO"


Line 68 is this:
Quote: "set display mode SYS_DisplayMode(DMode).width, SYS_DisplayMode(DMode).height, SYS_DisplayMode(DMode).depth"


Have read through numerous posts on the forum and tried all kinds of suggested solutions, but the error remains...

Have tried Renaming variables, Removing comments, ReOrdering commands, even tried deleting the whole function and rewriting it...

Any ideas of how to fix this?



Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 17th Jan 2011 22:13 Edited at: 17th Jan 2011 22:16
You UNDIM the arrays SYS_DisplayMode() and SYS_Timer(), but I believe you forgot to DIM them (unless I'm missing something)

EDIT: Ah. To create an array you have to use DIM, not GLOBAL. GLOBAL is for variables (although it can be used on arrays so long as you have the DIM command there as well)




Guns, cinematics, stealth, items and more!
enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 17th Jan 2011 22:17 Edited at: 17th Jan 2011 22:19
And the award for dim'ness goes to me!
How could I miss such an obvious error?

Thank you for putting me in my place, Sixty!

EDIT: Yeah, I know how these things work. I use these types of arrays in almost every program I make. Which just makes the mistake so much more ridiculous. Thanks again Sixty.

Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 18th Jan 2011 01:29
No problem! It looked like a careless error but I just wanted to be safe


Guns, cinematics, stealth, items and more!
enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 23rd Feb 2011 03:07
Quote: "Yeah, I know how these things work. I use these types of arrays in almost every program I make."

Wow, now that I read that... It sounds really mean... I apologise for that, as that was not my intention....

Login to post a reply

Server time is: 2026-07-17 19:13:42
Your offset time is: 2026-07-17 19:13:42