FilledStructureArray - Create an array of structures and assign initial values |
Top Previous Next |
Syntax
<aStructures> := FilledStructureArray( <oStructureClass>, [<aMemberVarList>], <aFillData> )
Parameters
<oStructureClass>
Class object of the structure to be used for the array.
<aMemberVarList>
List of member variable names to be filled from <aFillData>. Default is "all member variables".
<aFillData>
Data used to fill the member variables of the created structures.
Return value
A one-dimensional array of structures of class <oStructureClasss> filled from <aFillData>. If an no data is passed <aFillData>, an empty array ( {} ) is returned. The size of the returned array depends on <aFillData>.
Description
FilledStructureArray creates a 1-dimensional array (=list) of structures. The member variables specified in <aMemberVarList> of these structures are filled with the data passed in <aFillData>. If no member variables are specified, FilledStructureArray will assume all member variables to be filled.
If <aFillData> is a 1-dimensional array, FilledStructureArray starts with a list containing one structure as return value. Every value in <aFillData> is assigned top-to-bottom to its member variables specified in <aMemberVarList>. If all specified member variables of this structure have been assigned and there are still elements in <aFillData> left, the next structure is added to the return value. Then FilledStructureArray starts filling the new structurewith the remaining values. When the last value of <aFillData> has been assigned, FilledStructureArray finally returns. - In other words: FilledStructureArray creates as many structuresas necessary to process all values in <aFillArray>.
If <aFillData> is a 2-dimensional array, FilledStructureArray creates a 1-dimensional array (=list) of <oStructureClass> structures as return value. The size if this array is determined by the first dimension of <aFillData>. Then the member variables of all structures in the return value array are assigned with the values of the sub arrays in <aFillData>. The member variables to be assigned with the values in the sub arrays can be specified with <aMemberVarList>. If <aMemberVarList> is not specified, the member variables are assigned top-to-bottom with the values from the sub arrays in <aFillData>. - In other words: FilledStructureArray creates a structure for every element in <aFillData> and assigns its member variables with the values specified of each sub array.
Classification
Core
Category
Quick Info
Library: cckptcor.lib / cckptcor.dll
See also
StructureArray, StructureArrayFrom
Example
|