What's the point of the post? Earlier PB versions had a problem getting address of a structured variable inside a structure. Now thats ok (as the first part of the code below shows) but I've just discovered (see second part of code) that we can now use pointer vars in structures declared as pointers and useable without the "*" (contrary to many many previous postings). I'm suspicious that this is an unofficial "feature" or something. Can anyone (pref Fred) confirm that this behaviour is as designed and will remain in future PB versions?
Code: Select all
Structure strA
r.f
g.f
b.f
EndStructure
Structure strB
n.l
c.strA
x.l
*p.strA
EndStructure
objA.strA
objB.strB
Debug "Sub-structure Addressing"
Debug "========================"
Debug ""
Debug "Should be same)..."
Debug ""
Debug " @objB\c = "+Str(@objB\c)
Debug " @objB\c\r = "+Str(@objB\c\r)
Debug ""
Debug "Structure Pointers in Structures"
Debug "================================"
Debug ""
Debug "objA\r should be set via objB ptr..."
Debug ""
objA\r = 0
Debug "objA\r = "+Str(objA\r)+" (before)"
objB\p = @objA
objB\p\r = 999 ; <<< Look ma, no star!
Debug "@objA = "+Str(@objA)
Debug "objB\p = "+Str(objB\p)
Debug "objB\p\r = "+Str(objB\p\r)
Debug "objA\r = "+Str(objA\r)+" (after)"
Debug ""
