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 / DBPRO Data Principles - Data Types, Sizes, Optimization and Operations

Author
Message
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 12th Sep 2011 15:29 Edited at: 13th Sep 2011 12:40
Here is a guide which demonstrates how to use and optimize data to be saved to disk or be sent over a network. Find out the size of data types, how to store more than one property in the smallest datatype available and how to use binary expressions. The article features a data size knowledge test.

Visit page one of the guide



Disclaimer: If you know DBPRO like the back of your hand, and you work for Microsoft during the weekdays and you can produce a fully working Super Mario level 7 minutes, and you can spot 4 problems with this code snippet without compiling it
then leave this page now as the article may bore you to death, Chris is not to be held responsible for any damages caused.

If you have just installed DBPRO and you have not written more than 1000 lines of code in your life, and you think that a string and cord are both datatypes, and you think that declaring a 3D boat as a float will make it travel on water, and this is your first time here, then, welcome anyway.


Providing you have knowledge of how to use datatypes such as strings and floating point numbers, proceed with the article. If not, then it is recommended for you to look up the principles section of the shipped documentation; accessible by pressing F1 in your code editor. What you read in this article today may cause a panic attack, but tommorow it will make a little more sense. Be sure to add the article to your favourites if you wish to learn this stuff later.


Featured Article
Memblock Guide
Array Guide
All Articles
Projects
Downloads

Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 12th Sep 2011 17:35 Edited at: 12th Sep 2011 17:56
Quote: "(I lied about there only being 4 problems in the snippet above...)"


I see four problems.

1. No END after WAIT KEY (otherwise it'll error out when it hits the function)

2. "list delete element" should be "ARRAY DELETE ELEMENT"... unless "list delete element" is a command in a plugin I don't have. But technically it should be remed off because of Eat(0) to Eat(5) function calls... as elements are deleted the number will eventually go beyond the array size and thus causing an error.

3. "Sausages(0) = 1" should be "Sausages() = 1" so it's added to the end of the array rather than redefine the first element in the array.

4. Each time the ARRAY COUNT() command is called "Sausages" needs to have () added to it so ARRAY COUNT() detects the actual count of the array rather than showing -1 like it's an empty array. "ARRAY COUNT(Sausages)" changed to "ARRAY COUNT(Sausages())"

You're just lieing about lieing.

Edit: I do love your charts by the way. I'm going to grab your data chart as an image and use that as a reference instead of the one in the Darkbasic help files. I just wish booleans were true booleans in Darkbasic rather than acting like bytes with a 0 to 255 limit.

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 13th Nov 2011 14:00
Update: It has been 2 months and there have been updates to the articles.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Nov 2011 21:34
What a fun game

Grog,
Quote: "You're just lieing about lieing"

No he wasn't - you missed one:
inc Eaten

Eaten is a constant, so can't be incremented.

Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 15th Nov 2011 10:05
Quote: "No he wasn't - you missed one:
inc Eaten

Eaten is a constant, so can't be incremented.
"


Good eye.

Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 15th Nov 2011 12:18
It also seems that the constant ManySausages isn't used but he does declare TooManySausages in the first if statement giving it the value of 0.

Login to post a reply

Server time is: 2024-05-20 08:35:55
Your offset time is: 2024-05-20 08:35:55