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 / What does "as DWORD" means? XD

Author
Message
Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 27th May 2010 04:14
What does "as DWORD" means? XD
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 27th May 2010 05:40
It declares the variable before it as a DWORD, which is basically an unsigned long integer (Double WORD). It has a range of 0 to 4294967295.

Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 27th May 2010 06:49
mmm... whats the difference between all of this integers and all of those things to just putting what u want into a variable?
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 27th May 2010 09:24
Depends on what you`ll need the variable.The program need know what type is variable, so it can work with it.With integers you`ll store a lot of stuff in your game, mana , health, damage etc, most of the time coordinates you get from object in 3D space are floats, string you use for any kind of text.And so on.There is pretty good explanation in the help files of dbpro.Start with them.Then move on some tutorials, try examples, modify and you`ll understand everything.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 27th May 2010 17:14 Edited at: 27th May 2010 20:24
Dwords, floats, booleans, strings, etc. are all data types. They control how your program determines what type of information and how it is stored inside a variable. Press F1 inside DBP and navigate to "Principles" then "Datatypes and variables" to get a more in depth description.

Here are some samples:



My green thumb grew the tree my Trojan War horse was crafted from. With roses in our pockets we rally round the tombstones. Ashes to ashes, we all fall down.
Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 28th May 2010 00:20
Lol, ok, ty... But, i can still use variables and it would be the same, right?
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 28th May 2010 00:23 Edited at: 28th May 2010 00:41
DWYitzu as DWORD
StrYitzu$ as String
IntYitzu as Integer
FloYitzu as Float
BooYitzu as Boolean

Everything in bold is a variable. The "as DWord", "as String", etc just tells your program what kind of variable it is.



EDIT: Actually, I think the correct word usage I should use is: The "as DWord", "as String", etc just tells your program what kind of data your variable will hold.

It is my understanding that when you declare a variable, it stores its information in your memory (actually, I think it sets aside an amount equal to the maximum size of the type of variable dependless on whether it has information in it or not.) A boolean will store a 0 or a 1 which will take a lot less memory than storing a float. It's not such a huge deal with a smaller game, but with more intensive games, you will definitely need take this into consideration.

My green thumb grew the tree my Trojan War horse was crafted from. With roses in our pockets we rally round the tombstones. Ashes to ashes, we all fall down.
Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 28th May 2010 02:51
Ok, now i got it, ty

Login to post a reply

Server time is: 2024-09-28 18:16:00
Your offset time is: 2024-09-28 18:16:00