7.6

Table Of Contents
define(&myVar, string, '')
&myVar := xmlget('/PLANETPRESS_DATA_FILE[1]-
/CUSTOMER[1]/INVOICES[1]/INVOICE[1]/ITEM[1]/Description[1]')
&myVar := xmlget('/MyData/CUSTOMER[1]/INVOICES[1]/INVOICE[1]/ITEM[1]/Description[1]')
% This next line uses the &i variable to dynamically select an item in the invoice. Use-
ful in a repeat & overflow
% configuration, or a manual PlanetPress Talk loop through te data. Note that the var-
iable must be converted to a string.
&myVar := xmlget('-
/MyData/CUSTOMER[1]/INVOICES[1]/INVOICE[1]/ITEM['+inttostr(&i)+']/Description[1]')
Example 2
The following gets the number of items in an invoice, loops through each item and displays the item's description with show().
define(&i, integer, 0)
define(&currentItemDescription, string, '')
define(&numberOfItems, integer, xmlcount('/MyData/CUSTOMER/INVOICES/INVOICE/ITEM'))
for(&i, 1, 1, &numberOfItems)
&currentItemDescription := xmlget('-
/MyData/CUSTOMER/INVOICES/INVOICE/ITEM['+inttostr(&i)+']/Description')
show(&currentItemDescription)
crlf()
endfor()
Boolean
Add (function)
Adds two numerical expressions. This is the functional equivalent to the + operator, when you use the + operator with numer-
ical expressions.
Syntax
add( expression, expression2 ) integer, measure, currency value
Arguments
expression1, expression2
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 Examples
Examples 1 and 2 show both ways of adding numbers.
Example 1
show(inttostr(2+2)) %Displays 4
©2010 Objectif Lune Inc - 550 -