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 / Stuped but Simple question Constants and Classes

Author
Message
Shawn D
20
Years of Service
User Offline
Joined: 15th Jan 2004
Location:
Posted: 30th Jan 2004 11:21
My DB pro is in the mail.

How do a declare a constant

And can i Type my Vars/Constant
like

int i;
float j;
String myString;

And can i put scope modifiers on my variables
eg) private public

And can i make a class like

Class myClass...............

myClass inst = new myClass()

ShawnD
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 30th Jan 2004 12:00
With the contant, this needs to be like:

#CONSTANT MyVar 20

and you have to declare variables like:

i AS INTEGER
j AS FLOAT
myString AS STRING

Also to make them global

GLOBAL i AS INTEGER etc

I'm not sure about the class but there is user defined variable types.

TYPE MyType
i AS INTEGER
j AS FLOAT
myString AS STRING
ENDTYPE

newVar AS MyType

Hope this helps.

Jas
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th Jan 2004 16:04
ShawnD

dbp has no concept of Classes as it is not Object Oriented, it is procedural BASIC. You can use a type (similar to a C-based structure) like mentioned above.

good luck

-RUST-
"What the... Mooooooooooo!"
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 30th Jan 2004 16:41
Guys, you're missing a classic gag here.

#CONSTANT DarkBasic "Has no class."
--
TAZ

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th Jan 2004 16:49
zircher you for to wrap your post in <corny>...</corny> tags

-RUST-
"What the... Mooooooooooo!"
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 30th Jan 2004 17:30
My bad. I'll sit in the corner and say twenty 'duck and covers'. [I've been playing too much Fallout Tactics.]
--
TAZ

Login to post a reply

Server time is: 2024-11-26 01:33:29
Your offset time is: 2024-11-26 01:33:29