Where to dim arrays for a .dylib ?

Mac OSX specific forum
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Where to dim arrays for a .dylib ?

Post by wilbert »

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.
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Where to dim arrays for a .dylib ?

Post by Danilo »

You could make an Init function (All OS).
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Where to dim arrays for a .dylib ?

Post by wilbert »

Danilo wrote:You could make an Init function (All OS).
Is that allowed ?
The help file says
PureBasic Help wrote:The declaration of arrays, lists or map with Dim, NewList or NewMap must always be done inside the procedure AttachProcess.
If it can be done inside any procedure that would make things a lot easier.
Windows (x64)
Raspberry Pi OS (Arm64)
Fred
Administrator
Administrator
Posts: 18499
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Where to dim arrays for a .dylib ?

Post by Fred »

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).
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Where to dim arrays for a .dylib ?

Post by wilbert »

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).
Thanks for clarifying. :)
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply