public void WriteField (string aRecordID, int aFieldNumber, string aRecordData)
This method writes data to a single field in a record.
int aFieldNumber is the number of
the field to which data is to be written. If you do not specify aFieldNumber, this method writes to field 1.
UniDynArray aRecordData or string aRecordData is the field value to be written to the record. If you do not
specify aRecordData, the field value to be written
is the one set previously by the Record property.
string aRecordID is the ID of the record
to which the data is to be written. If you do not specify aRecordID,
the record ID is the one set previously by the RecordID property.
After executing the Write Field( ) method,
call the FileStatus property to determine the
state of record locks during the operation, as follows:
| Value | Description |
|---|---|
0 | The record was locked before the operation. |
–2 | The record was not locked before the operation. |
If this method fails, it throws a UniFileException.
This method corresponds to the UniObjects WriteField method and the BASIC WRITEV and WRITEVU statements.
This example writes the string NewFieldValue into field 3 of the record REC3.
int fieldnumber = 5;
string recID = “2”;
UniDynArray arr = new UniDynArray(us,”abc”);
fl.WriteField(recID, fieldnumber ,arr);