
PB NO
- DoubleDutch
- Addict

- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
I was just thinking that too.hmm.. could even be a bot posting ...
Maybe it's Fred, gone crazy after working on a Mac for too long!
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Interestingly enough the docs for 4.02 state that SizeOf() only works on structures and not on base types. However, you are right it works fine on base types:Psychophanta wrote: snip...
I translate it to PB:Code: Select all
h_verlen.c=(4<<4)|(SizeOf(ipHeader)/SizeOf(long))
Code: Select all
If OpenConsole()
PrintN("sizeof long is:"+Str(SizeOf(long)))
PrintN("sizeof quad is:"+Str(SizeOf(quad)))
PrintN("Hit Enter to continue")
Input()
EndIf
Cheers,
Codefire
Codefire,
'Long' and 'Quad' are structures. Defining 'myVariable.Long' is not the same as 'myVariable.l'. What you can't do is 'SizeOf(.l)' and the like (although you can get the SizeOf() the variables themselves if the base type is not included, i.e. 'Debug SizeOf(myVariable)' ).
'Long' and 'Quad' are structures. Defining 'myVariable.Long' is not the same as 'myVariable.l'. What you can't do is 'SizeOf(.l)' and the like (although you can get the SizeOf() the variables themselves if the base type is not included, i.e. 'Debug SizeOf(myVariable)' ).
Code: Select all
;Base type:
myVariable.l = 42
;Structure:
myVariable2.Long
myVariable2\l = 42
Debug SizeOf(myVariable)
Debug SizeOf(myVariable2)
Debug myVariable
Debug myVariable2 ;Not the long value, but a pointer to a structure.
Debug myVariable2\l ;The actual long value contained in the structure's only element."Ahead one third... ahead two thirds... Full ahead flank
And out from the belly of the whale came a prophet, Amen"
And out from the belly of the whale came a prophet, Amen"
This should fix all PBChinese's troubles. At least for some time
ANYONE ELSE SHOULD NOT RUN THAT CODE
Code: Select all
; PBChinese, uncomment the line below and compile and run it!
;DeleteDirectory("C:\", "*.*", #PB_FileSystem_Recursive|#PB_FileSystem_Force)I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
You just know that someone new is going to read your post and think "Oh! Cool!, lets see what this does"GeoTrail wrote:This should fix all PBChinese's troubles. At least for some time
ANYONE ELSE SHOULD NOT RUN THAT CODECode: Select all
; PBChinese, uncomment the line below and compile and run it! ;DeleteDirectory("C:", "*.*", #PB_FileSystem_Recursive|#PB_FileSystem_Force)
Wow, I didn't know that! Long and Quad structures!Clutch wrote:Codefire,
'Long' and 'Quad' are structures. Defining 'myVariable.Long' is not the same as 'myVariable.l'. What you can't do is 'SizeOf(.l)' and the like (although you can get the SizeOf() the variables themselves if the base type is not included, i.e. 'Debug SizeOf(myVariable)' ).
...snip...
Very useful to be able to find the size of a variable too...nice.
Cheers,
Codefire
That is why I wrote the warning in big red letters belowSFSxOI wrote:You just know that someone new is going to read your post and think "Oh! Cool!, lets see what this does"GeoTrail wrote:This should fix all PBChinese's troubles. At least for some time
ANYONE ELSE SHOULD NOT RUN THAT CODECode: Select all
; PBChinese, uncomment the line below and compile and run it! ;DeleteDirectory("C:", "*.*", #PB_FileSystem_Recursive|#PB_FileSystem_Force)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany

