ProcedureDLL MyLib_Init() ; Dim/NewList etc... always in _Init procedure
Global Dim a(5)
EndProcedure
ProcedureDLL proc(x)
a(2)=5
ProcedureReturn x
EndProcedure
For fatal error handling I find it very useful; otherwise you will have to pass it back through the whole module hierarchy, which might not be possible in case of fatal error.
You can't end a library. A library is never started
You can only end a program.
This make sense
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
It should not play any role whether a piece of code resides in a previously compiled library or the code actually compiled. As in other languages it makes no difference in which class or *.obj you end the pgm.
With all these restrictions you can never put a portion of a larger system into a library, you always have to recompile the whole bunch.