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 / TYPES whats the set up?

Author
Message
james1980
22
Years of Service
User Offline
Joined: 18th Sep 2002
Location:
Posted: 2nd Oct 2006 09:50
never used types and not sure how to set the up or use so alittle example would help, i dont quite understand the manual.
DarkMasta
18
Years of Service
User Offline
Joined: 21st Apr 2006
Location: Typed on your screen.
Posted: 2nd Oct 2006 10:35 Edited at: 2nd Oct 2006 10:39
The type-command lets you configurate your arrays in a way, so that you can use different datatypes such as strings, floats, bytes, integers, (see in "Getting Started"), etc. to the same array.

For e.g.:



I wrote this game within a school break. I'd have taken me far longer if I had to use different arrays and so forth...

Edit: I know, the "Fruit Seller" could be quite unrealistic — I haven't got the program to test it, but hopefully it works. If not, just tell me what's wrong...

Wherever you plan to go,
it's the next step you never know.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Oct 2006 10:43
Here's Dark's code in a workable version with the syntax errors corrected.

Not to sound cruel, but when posting code to a beginner, it's usually a good idea to have the syntax correct. In this case, the UDT was the main issue.



@James, UDT = User-Defined Type (incase you didn't know)

"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Oct 2006 11:33
There is a tutorial with sample code that may help. It goes further, showing you how to use types in arrays which is a very powerful tool...

http://www.thegamecreators.com/data/newsletter/newsletter_issue_28.html#9



james1980
22
Years of Service
User Offline
Joined: 18th Sep 2002
Location:
Posted: 3rd Oct 2006 01:53
i wasent sure how to set them up but that cleared it up enough ,Thx.
DarkMasta
18
Years of Service
User Offline
Joined: 21st Apr 2006
Location: Typed on your screen.
Posted: 4th Oct 2006 15:50
I know... You get to learn about DB best by yourself in the end.

Wherever you plan to go,
it's the next step you never know.
DarkMasta
18
Years of Service
User Offline
Joined: 21st Apr 2006
Location: Typed on your screen.
Posted: 4th Oct 2006 16:07 Edited at: 4th Oct 2006 16:07
@Phaelax,
Yeah, I'm quite messy with my coding. That's my bad habit. But I said, cheggit out and inform me if you find any errors.
I got somehow fond of this simple program, I even brightened it up a bit. If anybody's stil interested in it...



Wherever you plan to go,
it's the next step you never know.

Login to post a reply

Server time is: 2024-11-26 09:51:59
Your offset time is: 2024-11-26 09:51:59