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 / Does DB Pro support global variables?

Author
Message
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Jun 2003 02:06
That's it.
I'm a DBC user, that's why I'm asking the question.

If it does, what is the Syntax for declaring a global variable?
Thanks in advance.
All the Best,
StevieVee
madbilly
23
Years of Service
User Offline
Joined: 20th Mar 2003
Location: United Kingdom
Posted: 7th Jun 2003 02:21
just put the keyword global before the declaration, and it makes it global.
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 7th Jun 2003 02:56
I have no luck using just the keyword 'Global' However if I specify a data type then it does work.

usage:
global <variableName> as <variableType>

examples:
global playerName as string
global playerScore as integer
global playerXpos as float
global playerVectorThingamy as userDefinedDataType
global fileInformation as byte

etc.

Pneumatic Dryll

Login to post a reply

Server time is: 2026-07-12 00:07:48
Your offset time is: 2026-07-12 00:07:48