Get the contents of a field that is identified by its position.
Read an array of bytes direct from the workarea buffer.
XSharp.RT (in XSharp.RT.dll) Version: 2.4a
Syntax View Source
nFieldPos AS USUAL
) AS BYTE
public static byte FieldGetBytes(
[DefaultParameterValueAttribute(0, 1)] Usual nFieldPos
- Type: Usual
The position of the field in the database file structure for the current work area.
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.
The value of the field.
does not correspond to the position of any field in the database file, FieldGetBytes() will generate an error.
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.
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.
This will only work for DBF based workareas (not for Advantage workareas)
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
4FName := FIELDNAME(nFieldPos)
5FVal := &FName
7FVal := FieldGet(nFieldPos)