Try this. (Whether it is BYVAL or BYREF doesn't matter.)
[code]
declare sub sub1 (byval a as integer)
type b
value1 as uinteger
end type
dim b as b
dim a as b ptr
a = @b
#print typeof((*a).value1) 'Returns UINTEGER
(*a).value1 = 5
'sub1 (*a).value1 'Does not work!
sub1 ((*a).value1)
system
sub sub1 (byval a as integer)
print a
sleep
end sub
[/code]
It seems the compiler needs the extra parentheses to parse the value
correctly. It shouldn't, right?
André Victor T. Vicentini
compiler
None
Public
|
Date: 2009-07-09 06:48 PRINT isn't a function call, and doesn't allow the expression list to be |
|
Date: 2009-07-08 02:35 Interestingly, "print (*a).value1" does not error. I suppose "print |
|
Date: 2009-07-06 08:44 I think the problem is, when the parser sees that first open bracket '(', |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use