WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Array

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Array Extender

 Keywords:  

An extender that defines several functions to operate on WinBatch Arrays. This extender requires WinBatch version 2004B or later.

NOTE
Since this extender was written, WinBatch has added many new data types such as Unicode, Variant values, and pointers. This extender DOES NOT support these new data types, and may never do so. If you call it for arrays including data other than integer, floating-point, or ANSI strings, the results are unpredictable.

Variants, in particular, will cause the extender to return an error. (Variants require much special handling to avoid memory leaks, which are more than this amateur extender-writer is prepared to handle.) I DO NOT RECOMMEND IT FOR PRODUCTION SYSTEMS.

Author: Alan Kreutzer

[array44i_v4_0.zip]

To load the extender:

        AddExtender("Array44i.dll")


30 January 2007   Version 4.0
--------------------------------------------------------------------
The extender did not work correctly in the current WinBatch release
version 2006E.  The new version did not allow the extender to copy
strings directly from one winbatch variable to another.  This caused
the extender to fail when swapping array items, or when saving a string
passed as a parameter into an array. The extender has been modified to 
make a local copy of the source data, and then copy the local data to 
the output array.

The extender now checks for Variant data and returns an error. (Variant data requires special handling to avoid memory leaks, which is more than this amateur extender-writer is prepared to deal with.)

The ArraySort now uses the "QuickSort" algorithm, which is much faster than the previous sort method.

21 April 2004 Version 3.2.0 Archived: [array44i_v3_2_0.zip] -------------------------------------------------------------------- Error corrected: did not sort correctly if there were both floating point and strings values in the key fields.

New function: - "ArrayClear" enables you to set one or more array element "undefined." Allows you to delete records from a file when reading and writing with ArrayFileGet/ArrayFilePut or ArrayFileGetCSV/ArrayFilePutCSV.

5 April 2004 Verson 3.1.0 --------------------------------------------------------------------

This release of the ARRAY extender has been revised to use the new extender interface introduced by version 2004B of WinBatch. It cannot be used with any earlier version ov WinBatch.

This release should be considered a "beta" version, since 2004B itself is still beta.

Changes from previous versions. --------------------------------------------------------------------

Follwing the new naming convention, the extender file name is now: Array44i.dll

The ArraySort functions have been changed. In earlier versions the array that you passed as a parameter was sorted "in place", and the function return could be ignored. In this version, the array passed as a parameter is not changed. The function returns a duplicate of that array, sorted. To achieve the same result, lines like this...

ArraySort(MyArray)
Should be changed to...
MyArray = ArraySort(MyArray)

The array sort functions now have two additional parameters, StartRow and EndRow, which allow the sort to be restricted to only a part of the array. These parameters are optional, and the default is to sort the entire array, so no change is required in existing scripts.

There are two new functions... ArrayItemLocate and ArrayItemLocateNC These allow you to search an an array for a specific value. If you are searching a two-dimensional array, the search is confined to one column (you can specify which one.)


Article ID:   W16367
File Created: 2019:08:14:08:52:02
Last Updated: 2019:08:14:08:52:02