04-13-2023, 05:17 AM
(04-12-2023, 11:48 PM)Kernelpanic Wrote: In the present case, the meta command "$Dynamic" should/could help. The $Dynamic metacommand is a compiler switch that causes the compiler to not reserve fixed memory space for arrays during compilation.
The storage space is only requested at runtime; see the thread about static and dynamic arrays.
In QB64 the $Dynamic metacommand doesn't actually do much. Both static and dynamic arrays are allocated at runtime, but static arrays have a flag set on them that prevents
ReDimfrom working (it errors instead) and makes a handful of commands work slightly differently. When you use $Dynamic this flag isn't set so arrays created with
Dimare treated the same as those created with
ReDim.