7.4

Table Of Contents
Code Sample Example
This example prints the line items from an invoice. It defines the loop and total variables, loops through all records, shows and
positions invoice information, and finally shows the invoice total. The fields listed here are for illustration purposes only.
Example
define(&x,integer,1)
define(&tot,measure,0.0)
for(&x,1,1,subreccount())
show(field('PartNum'))
moveto(1.5,&current.y)
show(field('PartDesc'))
moveto(4.5,&current.y)
show(field('Qty'))
moveto(5.5,&current.y)
show(field('UnitPrice'))
moveto(6.5,&current.y)
show(field('Total'))
%Add line total to tot variable
set(&tot,&tot+ strtofloat(field('Total')))
moveto(0,&current.y+.25)
endfor()
moveto(6.5,8)
show(floattostr(&tot))
xmlCount()
Counts the number of children for a specific element, according to standard XPath syntax. The return value is an integer and
always returns 0 if the specified XPath is invalid or if no value is found. The XPath is always relative to the XML root path.
Syntax
xmlCount(path:string) integer value
Arguments
path
©2010 Objectif Lune Inc - 529 -