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.

AppGameKit Classic Chat / some help about tier1 vars

Author
Message
haliop
User Banned
Posted: 22nd Jul 2013 10:21
ok so as i learned

a byte is 1 byte
integer is 4 bytes
float is 4 bytes


but in AppGameKit an integer can get to a very high number...
so how does it works with AppGameKit tier 1?

what are the max a var can hold?
max byte i know its 255
max integer ?
max float ?

are there any other vars i can use that i just dont know exsists?

like an integer in C++ is a max of 32,### something cant remmeber the right number.

so what am i looking at incase of tier 1?

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 22nd Jul 2013 10:57 Edited at: 22nd Jul 2013 11:00
? 256^4 Byte
4294967296 Range without Sign

? 2^32 Bit
4294967296


INTEGER Range : -2,147,483,648 to 2,147,483,647
REAL Range : 3.4E +/- 38 (7 digits)

http://www.appgamekit.com/documentation/principles/1_datatypes.htm
haliop
User Banned
haliop
User Banned
Posted: 22nd Jul 2013 14:32
so in tier 1
i have
Integer
Float
and String ?
thats it? am i missing something?

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 22nd Jul 2013 16:18
yes, i think that are all in tier1.
for boolean you can use 1 & 0 in integer.

for desktop apps currency types are useful and 64+ bit datatypes
for physics simulations.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Jul 2013 17:22
In Tier 1, you are limited to integer (4 bytes, range -2,147,483,648 to 2,147,483,647), float (4 bytes, range 3.4E +/- 38 (7 digits)) and string types.

There are file commands that work with byte. But, since byte is not supported as a basic type in Tier 1, those commands are really only valuable in Tier 2.

In Tier 2 you have the option for signed and unsigned integers, bytes and longs. A long integer is 8 bytes (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807). And, you get the boolean type as well. For floating point values you have 4 byte float and an 8 byte double types.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 22nd Jul 2013 22:15 Edited at: 22nd Jul 2013 22:17
I wouldn't worry about the exact sizes (I never do). Just remember that integer is your basic most efficient unit in general. Floats are less efficient (speed and memory wise) but obviously needed quite often. Stings are well, for strings, letters and such as I am sure you are aware. I use them a lot myself. I never use boolean (mainly I forget, too ZX spectrum regulated lol), as I just tend to use a normal integer for that, but it could well be more efficient if you only intend an on or off flag.

I just use common sense, think what will be needed, and use the relevant variable type.

Login to post a reply

Server time is: 2024-11-24 18:55:00
Your offset time is: 2024-11-24 18:55:00