Navigation: ABC Library Reference > FileManager > FileManager Methods >====== ValidateField (validate a field) ====== | ![]() ![]() |
ValidateField( **//field id //), VIRTUAL, PROC**
| ValidateField | Validates the current record buffer value of the specified field and returns a success or failure indicator. |
| field id | A numeric constant, variable, EQUATE, or expression that identifies the field to validate. The field is ientified by its position in the FILE declaration. A value of one (1) indicates the first field, two (2) indicates the second field, etc. |
The **ValidateField **method initiates the validation of the field's buffer and requests that any errors be reported to the user. Level:Benign is returned if no errors occur.
Implementation:
The ValidateField method calls the ValidateFieldServer method to validate the field's contents.
Return Data Type: BYTE
Example:
MyFile FILE,DRIVER('TOPSPEED'),THREAD
Record RECORD,PRE()
TGroup GROUP !field id 1
Name STRING(20) !field id 2
Name2 STRING(20) !field id 3
FirstName STRING(10),OVER(Name2) !field id 4
** END**
Another STRING(10) !field id 5
** END**
** END**
** CODE**
** !program code**
** Access:MyFile.ValidateField(4) !validate FirstName**
See Also: ValidateFields, ValidateFieldServer





