It's the *MyPtr.SArray = ?MyData that does the setup.
The ! at the start of a line means the PB compiler passes these through to the assembler, ie these are assembler lines.
The strptr macro is a FASM macro that sets up the string array for you (I have it defined in an include file).
Basically it creates a data structure that contains pointers to each of the strings passed to it so you end up with...
MyData:
<pointer to string 1>
<pointer to string 2>
... etc ...
<string 1 data, 0>
<string 2 data, 0>
.. etc ...
The thing at MyData is therefore the string array. If you want to use the pointers to these preset strings, just overlay another data structure at the same place or use a union as Trond's example.
Part of the power of PB is the ease of use of assembler - and it's possible to get pointers to anything you want with that.
Looking at your original post - the first call of the testing function works for me (even though it's not officially supported).
The PB guaranteed way to do this would be...
Code: Select all
Procedure TestingPointers2(*s)
Debug "Doing Pointers S :" + PeekS(*s)
Debug *s
EndProcedure
TestingPointers2(@"CONSTANT")