02 March 2017

A Dynamic Array Library

James Gaite created an impressive extension to the standard GFA-BASIC 32 array functionality. In response to comments made in a thread on the GB32 forum, he has spent some time trying to compile some basic dynamic objects that will work within a UDT, as well as making GFA-BASIC's handling of arrays in variants a bit more flexible.

The results are contained in the zipped library file containing a compiled library file (lg32) and a with a brief help file. For easy access you should copy the lg32-file into the source directory of the project you are working on. Including a library file in your project forces the IDE to search for that file in the current working directory first.
Please note that this is a work in progress, as can be seen by the version number.
Dynamic Array Library (version 0.22 Build 9) : DynamicArrays.zip

Main features (but not all):
  1. A Hash table (THash) that:
     - can be used in User-defined Types and Arrays, and can be passed ByRef to functions and subroutines;
       - can 'remember' sort preferences and add all new keys accordingly.
  2. . A Dynamic Variable-length String Array (DSArray or DSA) which:
       - can be used in User-defined Types and Arrays and be passed to all routines;
       - can 'remember' sort preferences and add all new additions accordingly;
       - has basic find, find/replace and find/remove functions.
  3. A basic Variable-length String Variable that can be used in User-defined Types.
  4. New commands and functions for Redim'ing and setting values in a dynamic array in a variant.
Please post any questions (or bugs you might discover) to this thread on the GB32 forum http://gb32.proboards.com/thread/117/dynamic-variables-arrays or as comments attached to this blog article.