7.4

Table Of Contents
Integer, measure or currency values. Both expressions must be the same type. The returned value is set according to the type
of the parameters.
Code Sample Example
Example 1 and Example 2 illustrates both ways of subtracting numbers.
Example 1
show(inttostr(2-2))
Example 2
show(floattostr(sub(4.7,2.1)))
SubRecCount (function)
Returns the number of records per data page. Since data pages can hold a variable number of records, this value may change
whenever you skip through data pages. Every data page always has at least one child, otherwise it wouldn't be stored in the
database. Subreccount can return 0 only if the emulation is set to something other than database mode, or if the converted
database is invalid. This function is only useful in database emulation mode.
Syntax
subreccount integer value
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)
©2010 Objectif Lune Inc - 369 -