DbServer.GetArray Method (Typed) | |
Retrieve an array of values from a field in the server, subject to the currently active selection, if any.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.19
Syntax VIRTUAL METHOD GetArray(
nMaxRows AS LONG,
uField1 AS USUAL,
uSearchValue AS USUAL
) AS ARRAY
public virtual Array GetArray(
[DefaultParameterValueAttribute(100, 0)] int nMaxRows,
[DefaultParameterValueAttribute(1, 0)] Usual uField1,
[DefaultParameterValueAttribute(0, 1)] Usual uSearchValue
)
Request Example
View SourceParameters
- nMaxRows
- Type: Long
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:
Array
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:
1oDB := DBServer{"products",#Shared,#ReadOnly}
2oDB:SetIndex("prodno")
3aProducts := oDB:GetArray(100,#ProdName, 22750)
4oDB:Close()
See Also