JCL Help:TDynArray

From Project JEDI Wiki
Jump to navigationJump to search


Summary

A dynamic array of some type.


Description

TDynArray represents a dynamic array. Depending on the compiler version this is an actual dynamic array or a simulated dynamic array. The tables below show the declaration of the dynamic array types. When the compiler natively supports dynamic arrays you can work with types just as if they were declared using the array of Type syntax. If the compiler doesn't support dynamic arrays you must use the various DynArrayXxx routines. Before you can use a TDynArray you must initialize it using DynArrayInitialize. To query or change the length of the array you use DynArrayLength and DynArraySetLength respectively. To reference an element of the array you use MyArray^[Index] where Index is the index of the element between 0 and the length of the array minus 1. When you are done with the array you must release it's memory by calling DynArrayFinalize. Compiler supports dynamic arrays (Note that routines that take a TDynArray as a parameter need an actual TDynArray so you can't declare the parameter using the "array of Type" syntax):

Type Declaration
TDynByteArray array of Byte
TDynShortArray array of Shortint
TDynSmallintArray array of Smallint
TDynWordArray array of Word
TDynIntegerArray array of Integer
TDynLongintArray array of Longint
TDynCardinalArray array of Cardinal
TDynInt64Array array of Int64
TDynSizeIntArray array of SizeInt
TDynExtendedArray array of Extended
TDynDoubleArray array of Double
TDynSingleArray array of Single


About

Donator

Marcel van Brakel


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page