7.5

Table Of Contents
Code Sample Example
define(&result, string, '')
&result := ExpandString('%{global.GlobalVar}')
show(&result)
% Also works with system variables
&result := ExpandString('%o')
show(&result)
Field (function)
Returns the contents of the specified field for the current record. This function is only useful in database emulation mode.
Syntax
field( fieldname[, recordnumber] ) string value
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()
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
©2010 Objectif Lune Inc - 542 -