7.5

Table Of Contents
Argument
fieldname
String value specifying the name of the field whose value you want to retrieve.
recordnumber
Integer value specifying the number of the record, in the current record set, whose value you want to retrieve. If you omit this
argument, the document uses the value of &current.line.
This argument is case sensitive. Thus the field names OrderNumber and ORDERNUMBER are not equivalent.
Code Sample Example
This example shows how to print the name and content of the current record in a generic fashion.
Example
define(&x,integer,1) //Define loop variable
define(&fn,string,'') //Define name variable
margin(0,0)
for(&x,1,1,fieldcount()) //Loop through all fields
set(&fn, fieldname(&x)) //Store field name
show(&fn) //Display field name
moveto(2,&current.y) //Move right
show(field(&fn)) //Display field contents
crlf() //Move to next line
endfor()
FieldCount (function)
Returns a count of fields in the current database record. Since all records always hold the same number of fields, this value will
not change unless a new sample data file is used. This function is only useful in database emulation mode.
Syntax
fieldcount() integer value
Code Sample Example
"Field (function)" (page 542)
FieldName (function)
Returns the name of the specified field for the current record. This function is only useful in database emulation mode.
Syntax
fieldname( index ) string value
Argument
index
Integer value specifying the index of the field whose name should be retrieved. Correct values range from 1 to fieldcount().
©2010 Objectif Lune Inc - 488 -