up previous next
fields

list the fields of a record

Syntax
fields(P:RECORD):LIST

Description
This function returns a list of all of the fields of the record P. It is particularly useful when you want to know if a record field has been defined

Example
/**/  P := Record[ Name := "David", Number := 3728852, Data := ["X","Y"] ];
/**/  fields(P);
["Data", "Name", "Number"]

/**/  P.Data;
["X", "Y"]

/**/  "Surname" IsIn fields(P);
false

See Also