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 / Declaring a variable as constant

Author
Message
schoenhs
20
Years of Service
User Offline
Joined: 29th Nov 2003
Location:
Posted: 26th Dec 2003 12:37
hey im sure that there must be a really easy way to do this, i just havnt figured it out yet, please help
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 26th Dec 2003 14:27
in dbp its:
#constant <variable>
i not usre if dbc can do them though


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
schoenhs
20
Years of Service
User Offline
Joined: 29th Nov 2003
Location:
Posted: 26th Dec 2003 14:37
ok thanks but i have two questions, firstly i assume that when i use the #constant flag the variables are global right and secondly i have one constant that i declare like this,
#constant Preferences$ = "Preferences.dat"
but it gives me the error that i can only use alphanumeric charicters... what is wrong with this?
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 26th Dec 2003 14:42
yup i think they are global, i get the same error as you for that line as well,
#constant Preferences as string = "Pref.dat"
that however does work


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
schoenhs
20
Years of Service
User Offline
Joined: 29th Nov 2003
Location:
Posted: 26th Dec 2003 14:55
ahh rite thanks for all the help btw when i try to use it like
if file exist(Preferences)
it gives me the error of
"could not determine parameter type of 'as string' at line 43"

sorry for all of the trouble
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 26th Dec 2003 18:24
Use #constant Preferences = "Pref.dat"

#constants in dbpro arn't actual constants, they are more like macros in c.
eg.


dbpro : p166mmx @ 233 : 256mb : sb 128pci : sis onboard
schoenhs
20
Years of Service
User Offline
Joined: 29th Nov 2003
Location:
Posted: 26th Dec 2003 19:11
ahhh alrite thanks alot this works perfectly

Login to post a reply

Server time is: 2024-09-21 14:58:19
Your offset time is: 2024-09-21 14:58:19