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 / global variables

Author
Message
Mickyfyn
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location: UK
Posted: 1st Dec 2003 18:30
Hi I have been reading a message from Jaze regarding global variables in DBPro, is there a global variable in common or garden Darkbasic. It seems that I have to declare an array with 1 element, which seems a lot a hassle compared to declaring a variable as global.

Am I missing something or have I got it right. I have only just bought Dark Basic any help would appreciated.

Mickyfyn
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 1st Dec 2003 20:01
Quote: "is there a global variable in common or garden Darkbasic"


what?


Global intMyVar as Integer

-RUST-
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 1st Dec 2003 20:13 Edited at: 1st Dec 2003 20:15
I think common or garden Darkbasic = darkbasic classic. It's an english expression.
If the global keyword doesn't work then I would guess dbc doesn't support globals unlike dbpro.

dbpro : p166mmx @ 233 : 256mb : sb 128pci : sis onboard
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 1st Dec 2003 20:55
oh. sorry. I got lost in the Brittishness of it all -
lol.
sorry.

-RUST-
JNC
20
Years of Service
User Offline
Joined: 29th Nov 2003
Location:
Posted: 2nd Dec 2003 07:50
No, there are no Global Variables in DBC (Dark Basic Classic); you will have to long code out soemthing like that. Create a function with a do loop to set variabl behavior.

-- do not seek the footsetps of the wiseman
-- seek what he sought
Mickyfyn
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location: UK
Posted: 2nd Dec 2003 12:36
Thank you for all you comments.

Mickyfyn
Guyon
21
Years of Service
User Offline
Joined: 6th Jun 2003
Location: United States
Posted: 2nd Dec 2003 14:27 Edited at: 2nd Dec 2003 14:28
Arrays are always Global.
I wrote you a mini tutorial on Variable and how they work with functions in Code Snippets:

http://darkbasic.thegamecreators.com/?m=forum_view&t=21101&b=6

Login to post a reply

Server time is: 2024-09-21 11:46:55
Your offset time is: 2024-09-21 11:46:55