DbServer.GetLookupTable Method | |
Retrieve a two-column array of values from two fields in the server, subject to the currently active selection, if any.
Namespace:
VO
Assembly:
VORDDClasses (in VORDDClasses.dll) Version: 2.19
Syntax VIRTUAL METHOD GetLookupTable(
nMaxRows,
uField1,
uField2,
uSearchValue
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public virtual Usual GetLookupTable(
Usual nMaxRows = default,
Usual uField1 = default,
Usual uField2 = default,
Usual uSearchValue = default
)
Request Example
View SourceParameters
- nMaxRows (Optional)
- Type: Usual
The maximum number of rows that should be retrieved. If omitted, 100 rows at most are retrieved. - uField1 (Optional)
- Type: Usual
The name, number, or symbol of the first field to be retrieved. If omitted, the first field is retrieved. - uField2 (Optional)
- Type: Usual
The name, number, or symbol of the second field to be retrieved. If omitted, the second field is retrieved. - uSearchValue (Optional)
- 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
The method returns a two-column array of values found for the specified fields, 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 translation lists in user interfacing. The resulting array can be used in ATranslate().
Examples
The following builds a lookup table, for example to translate product codes into product names and vice versa, beginning at the indicated product number:
1oDB := DBServer{"products",#Shared,#ReadOnly}
2oDB:SetIndex("prodno")
3aProducts := oDB:GetLookupTable(500,#ProdNo,#ProdName, 22750)
4oDB:Close()
See Also