@acc() Function

Top  Previous  Next

@acc() function is used to accumulate data within the given variable. This function can be used to concatenate strings or to increase/decrease numeric values.

Syntax:

@acc(variable, accumulate-by-expression[, delimiter])

 
variable

A target symbol where accumulated data will be stored. It can be a Process Record field, a Pool Variable or an ADOM Node.

accumulate-by-expression

The value of the expression will be accumulated in variable

delimiter

This optional parameter can be used when accumulating string data and it will be placed between accumulate-by-expression values. The delimiter is not placed for the first accumulation.

Examples:

Example 1:

@acc(v:count, 1)        @// Increase the value of v:count by 1

 
Example 2:

@acc(v:total, f:AMOUNT) @// Increase the value of f:total by the value of f:AMOUNT

 
f:AMOUNT  v:total 

------    --------

10        10

-3        7

4         11

 
Example 3:

@acc(v:where_clause, 'NAME = ''' + f:NAME + '''', ' OR ') 

 
f:NAME     v:where_clause 

----       --------------------------

John       NAME = 'John'

Susan      NAME = 'John' OR NAME = 'Susan' 

Jane       NAME = 'John' OR NAME = 'Susan' OR NAME = 'Jane'

 
See @accfa(), @accfs()