FieldGet Function | |
Get the contents of a field that is identified by its position.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION FieldGet(
nFieldPos
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static Usual FieldGet(
Usual nFieldPos = default
)
Request Example
View SourceParameters
- nFieldPos (Optional)
- Type: Usual
The position of the field in the database file structure for the current work area.
Return Value
Type:
Usual
The value of the specified field.
If
nFieldPos does not correspond to the position of any
field in the current database file, FieldGet() will generate a runtime error. Only in the Xbase++ dialect a NIL will be returned.
Remarks
FieldGet() retrieves the value of a field using its position within the database file structure rather than its field name. Within generic database service functions this allows, among other things, the retrieval of field values without use of the macro operator.
Tip |
---|
FieldGet() can be used with a BLOB field (that is, a memo field associated with a BLOB file), provided the length of the field does not exceed 64 KB.
For BLOB fields longer than 64 KB, use the BLOBGet() function instead.
|
Examples
This example compares FieldGet() to functionally equivalent code that uses the macro operator to retrieve the value of a field:
1LOCAL nFieldPos := 1, FName, FVal
2USE customer NEW
3
4FName := FIELDNAME(nFieldPos)
5FVal := &FName
6
7FVal := FieldGet(nFieldPos)
See Also