Click or drag to resize

DbServer.GetArray Method

Retrieve an array of values from a field in the server, subject to the currently active selection, if any.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.5
Syntax
 VIRTUAL METHOD GetArray(
	nMaxRows AS USUAL,
	uField1 AS USUAL,
	uSearchValue AS USUAL
) AS USUAL

Parameters

nMaxRows
Type: Usual
The maximum number of rows that should be retrieved.  If omitted, a maximum of 100 rows are retrieved.
uField1
Type: Usual
The name, number, or symbol representing the field to be retrieved.  If omitted, the first field is retrieved.
uSearchValue
Type: Usual
The value to be searched for, under the currently controlling order.  The system performs a Seek() operation, and then proceeds to load up the array from there.

Return Value

Type: Usual
An array of values found for the specified field, moving sequentially until the specified maximum number of rows or until end of file.  If a selection is active, the method includes only records from that selection.  The values are retrieved under the current controlling order, if any. Note that the method does not reposition to the beginning before starting to fill the array.  Either provide a start value, or explicitly position the server before using the method.  (This allows incremental reading, building up an array in pieces.)
Remarks
Sends a NotifyIntentToMove message before the operation.  Sends a NotifyRecordChange message upon completion, and leaves the server positioned at the last record used or at end of file (last file record).  One use of this method is to populate validation lists in user interfacing.
Examples
The following fills an array with product names for use as validation values, beginning at the indicated product number:
X#
1oDB := DBServer{"products",#Shared,#ReadOnly}
2oDB:SetIndex("prodno")
3aProducts := oDB:GetArray(100,#ProdName, 22750)
4oDB:Close()
See Also