[futurebasic] [FB3]SIZEOF Question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2000 : Group Archive : Group : All Groups

From: Yukihisa Hara <akiyuki@...>
Date: Mon, 10 Apr 2000 23:06:01 +0900
Hi.
I trying to this code below. But two question is

(Q1)Why TQ3Bitmap size is 9? I think 12...

(Q2)Why ximage2 size appear? This is not defined. So, I think that error
must display "This Variable Was Not Defind".And I think these way are much
better.
SIZEOF(ximage2) -->Sytanx err. Becuse ximage2 is valiable.
(Current 3.2.0:No err)
SIZEOF(TQ3Bitmap2.ximage2) -->collect ximage2 size
(Current 3.2.0:err)

(example)
begin record TQ3Bitmap
dim ximage2   as ptr to char
dim xWidth    as unsigned long
dim xHeight   as unsigned long
end record

begin record TQ3Bitmap2
dim ximage2   as TQ3Bitmap
dim xWidth    as unsigned long
dim xHeight   as unsigned long
end record

dim ximage2 as boolean

I'm confuse. What happen?
---------------------------------------
--yukihisa hara(akiyuki@...) --
---------------------------------------

(SOURCE CODE)
end globals
//---
begin record TQ3Bitmap
dim ximage    as ptr to char
dim xWidth    as unsigned long
dim xHeight   as unsigned long
end record

begin record TQ3Bitmap2
dim ximage2   as ptr
dim xWidth2   as unsigned long
dim xHeight2  as unsigned long
end record
//---
window 1
print "Q1"
print "TQ3Bitmap ";sizeof(TQ3Bitmap)
print "---"
print "Q2"
print "TQ3Bitmap2";sizeof(TQ3Bitmap2)
print "ximage2   ";sizeof(ximage2)
print "xWidth2   ";sizeof(xWidth2)
print "xHeight2  ";sizeof(xHeight2)
//---
do
until len(inkey$)

(RESULT)
Q1
TQ3Bitmap 9
Q2
TQ3Bitmap2 12
ximage 2
xWidth 2
xHeight 2