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 / A question on data types.

Author
Message
MACRO
23
Years of Service
User Offline
Joined: 10th Jun 2003
Location:
Posted: 11th Jun 2003 00:53
Hi

I just wanted clarification on a data type.

In the listed suported data types on the main page of the darkbasicpro.co.uk page there is a type "types" listed.

Could someone please elaborate on this for me.

I am mainly a java programmer and have some C and C# experiance along with VB.

What structure in these languages would this type be equivilent to. Dould it allow me to effectivly define objects by a set of values for example in pseudo code:

type mytype
int speed
int xcoord
int ycoord
int zcoord
end type

mytype x = new mytype
x.speed = 5;

Or have I got the completely wrong end of the stick.

Cheers for your help

Fred
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 11th Jun 2003 01:02
ype mytype
int speed
int xcoord
int ycoord
int zcoord
end type

mytype x = new mytype
x.speed = 5;

in dbp would be

type mytype
speed as integer
xcoord as integer
ycoord as integer
zcoord as integer
endtype

x as mytype
x.speed=5



Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
Vandetta
23
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 11th Jun 2003 01:12
Types in Darkbasic are basically structures in C, they are not equivalent to objects as they can only hold other data types not functions.

MACRO
23
Years of Service
User Offline
Joined: 10th Jun 2003
Location:
Posted: 11th Jun 2003 02:45
Cheers

I knew that it would not be an object but I was hoping that it would be basically a struct.

I am using Jamagic for a game at the moment but am thinking of ditching it for DPPRO because the collision detection isnt up to the task I want it to perform. I know DB can do it because I have the origional.

I will miss the objects but I think for my purposes DB is probably more suited anyway.

Cheers

Fred

Login to post a reply

Server time is: 2026-07-11 11:42:03
Your offset time is: 2026-07-11 11:42:03