just updating some code to use some of the new features (PB 4.5), in particular discarding some code for clearing dynamic structures in favour of the new ClearStructure() etc.
Came across some nested structure pointers in which it would be nice (

Take the following structure for example :
Code: Select all
Structure test
a$
*ptrString.STRING
EndStructure
Code: Select all
*ptr.test = AllocateMemory(SizeOf(test))
If *ptr
*ptr\a$ = "Hello matey!"
*ptr\ptrString = AllocateMemory(SizeOf(STRING))
If *ptr\ptrString
*ptr\ptrString\s = "Hello again!"
EndIf
EndIf
Code: Select all
ClearStructure(*ptr\ptrString, STRING)
ClearStructure(*ptr, test)

I was just wondering, however, if it would be viable to add some optional parameter to ClearStructure() so that it could run through and clear both structures in one go? I would then be able to replace my two previous calls to ClearStructure() with something like :
Code: Select all
ClearStructure(*ptr, test, #PB_Structure_ClearNested)

Thanks.