7.5

Table Of Contents
Getmetacount (function)
Returns the number of times an attribute or a field is encountered in the current metadata hierarchy. It can also be used to ver-
ify whether a field or attribute exists by comparing the returned value to zero. Note that attributes can only appear once, and
thus can only yield two possible values, either zero or one.
Syntax
getmetacount(name: string[, flags: integer, path: string]) integer
Arguments
name
The name of the metadata value to count.
flags
Optional integer value to define the behavior of the command.The default behavior uses 0. The flag value to enter should be
the sum of all desired flags. (Eg: GetAttribute and FailIfNotFound would give a flag value of '5').
Name Value Behavior
GetAttribute 1
Search for the name argument in the attribute instead of
the default field .
NoCascade 2
Search only the level specified by the path argument
(defaults toPage level when path argument is empty),
instead of default behavior, going from the Page levelto
the Job level.
FailIfNotFound 4
Raise an error and crash the job is the specified nameis
not found instead of returning an empty string.
path
Optional string value to specify the level where to start counting the field or attribute. Path components cannot be indexed, and
if no path
is provided, the search is done from the the Page level.
Note: The node names of the path argument can have an optional zero-based index, indicated between square brackets ('[
]'), to access a specific node. If no index is provided, the first node is used.
Also note that , if no attribute nor field is found, the command returns zero, unless the FailIfNotFound flag is specified.
Code Sample Example
This example shows the syntax for the GetMetacount() function.
% Retrieve and count the number of iterations of "address" for the current datapage
Getmetacount('address')
©2010 Objectif Lune Inc - 493 -