[futurebasic] Replacing semicolon syntax in records

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2007 : Group Archive : Group : All Groups

From: Bernie <fblist.bw@...>
Date: Sun, 14 Oct 2007 10:16:21 +0100
Looking for a replacement for the semicolon syntax in records...

Example:

'------------
begin record TestRec
dim as long dummy
dim myPoint;0, vert, horz
end record

dim as TestRec info

info.myPoint.h% = 100
info.myPoint.v% = 200

print info.myPoint.h%,info.myPoint.v%
print info.horz,info.vert
'------------


I've come up with one solution:

'------------
begin record TestRecUnion
dim as short vert, horz
end record

begin record TestRec
dim as long dummy
begin union
dim as Point myPoint
dim as TestRecUnion u
end union
end record

dim as TestRec info

info.myPoint.h% = 100
info.myPoint.v% = 200

print info.myPoint.h%,info.myPoint.v%
print info.u.horz,info.u.vert
'------------


Questions:

[1] Are there any pitfalls to this approach (endian issues)?
[2] Is there a better way?


Bernie