The PB docs mention AttachProcess as the place to dim arrays and maps for windows.
Where should this be done for a OS X dylib ?
I want to dim some global arrays but have no clue where that should be done.
Where to dim arrays for a .dylib ?
Where to dim arrays for a .dylib ?
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: Where to dim arrays for a .dylib ?
You could make an Init function (All OS).
Re: Where to dim arrays for a .dylib ?
Is that allowed ?Danilo wrote:You could make an Init function (All OS).
The help file says
If it can be done inside any procedure that would make things a lot easier.PureBasic Help wrote:The declaration of arrays, lists or map with Dim, NewList or NewMap must always be done inside the procedure AttachProcess.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: Where to dim arrays for a .dylib ?
It can be done in any procedure, it was for "global" items. But I think that's history as you can put it outside and it should be automatically executed when the DLL loads (basically all code outside procedure is executed when the DLL loads).
Re: Where to dim arrays for a .dylib ?
Thanks for clarifying.Fred wrote:It can be done in any procedure, it was for "global" items. But I think that's history as you can put it outside and it should be automatically executed when the DLL loads (basically all code outside procedure is executed when the DLL loads).
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)


