[Gambas-user] Object.address() returns wrong address for a structure

Brian G brian at westwoodsvcs.com
Sun Mar 26 05:09:46 CEST 2023


When getting the address for a structure object the wrong address is returned. It looks like the address returned is a control block of some sort. 
object.sizeof() does return the correct length for the structure. 

I thought it would return the same address as was assigned to it. 

dim a as pointer = alloc(1000,1) 
dim b as MyStruct 
b = a 
then 
object.address(b) should equal a 

But instead it seems to return some sort of control block, but I expected for a structure to just recieve the same address as was assigned. 

If this is correct, then is there a way to get the assigned address for a structure object? 

"Failure is the key to success; 
each mistake teaches us something" .. Morihei Ueshiba 
Brian G 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230325/78a75864/attachment.htm>


More information about the User mailing list