Page 1 of 1
Posted: Mon Sep 17, 2001 3:10 pm
by BackupUser
Restored from previous forum. Originally posted by richard.
hi,
is there a sizeof in PB to use with structres???
is there a mod function?
thanx
richard
Posted: Mon Sep 17, 2001 6:08 pm
by BackupUser
Restored from previous forum. Originally posted by WooTz.
Hey,
Can't you calculate the size yourself? integer, long etc. are fixed length, and the string you can get with Len().
As for the mod:
while (numerator >= denominator)
numerator = numerator - denominator;
return numerator
thats just the pseudo code, go ahead and port it im still learning pure basic
Martin
Posted: Mon Sep 17, 2001 6:58 pm
by BackupUser
Restored from previous forum. Originally posted by richard.
hi,
sure one can count, but there are a lot of things missing in this basic. all those litte thing that make life nice and easier like - mod, shift ... and sizeof.
for example see gfa basic or the hla assembler
http://webster.cs.ucr.edu/.
there are a lot of important things missing, like documentation,containers and other things.
richard
Posted: Mon Sep 17, 2001 7:04 pm
by BackupUser
Restored from previous forum. Originally posted by WooTz.
umm i dont believe there's a sizeof in QBasic or VB as well... and mod you could write on yourself OR use inline assembly in Pure Basic.....
Edited by - WooTz on 17 September 2001 20:40:46
Posted: Mon Sep 17, 2001 11:27 pm
by BackupUser
Restored from previous forum. Originally posted by fred.
hi,
sure one can count, but there are a lot of things missing in this basic. all those litte thing that make life nice and easier like - mod, shift ... and sizeof.
Of course there is a SizeOf() function for structures.. Just try the following line:
MessageRequester("", Str(SizeOf(RECT)), 0)
And yes, shift are supported:
FastMulByTwo = Number > 2
It's like in C/C++.
BTW, the PureBasic compiler is smart enough to convert all mul & div by shift when it's possible..
So, only the mod stuff is missing
Fred - AlphaSND
Posted: Tue Sep 18, 2001 7:39 am
by BackupUser
Restored from previous forum. Originally posted by WooTz.
I gave him the MOD =)
Logic dictates, that once you have eliminated the impossible, what ever remains, however improbable, must be the truth