Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
themeConfluence
FUNCTION xpxSelectAggrInstances (aggrId                   : AGGREGATE OF GENERIC;
                                 condition                : STRING;
                                 options                  : INTEGER;
                                 firstIndex, maxHits      : INTEGER;
                                 VAR indexOfLastFound     : INTEGER;
                                 VAR actualHits           : INTEGER;
                                 VAR foundInstances       : AGGREGATE OF GENERIC)
                                 status                   : INTEGER;

The xpxSelectAggrInstances function returns a list containing the indexes of all the instances within an aggregate that matches a given Express-X logical expression.
The arguments for the function are:
 

...

Argument::

...

Arguments

...

1TypeNameComment
2AGGREGATE OF GENERIC

aggrId

A numeric aggregateID that uniquely identifies the aggregate of interest in the EDMdatabase. This may be any type of aggregate, persistantpersistent, volatile or scratch.

3STRING

condition

A conditional statement, written in Express-X, that the instances shall match.
A valid condition is any Express-X logical expression that refers to any number of attributes defined for the type of instance that is stored in the aggregate element. The instances in the aggregate elements may be of different types. Instances that do not possess all the attributes that are being referred to in the <condition> argument will allways always evaluate to sdaiUNKNOWN. These elements are considered not matching. The logical expression may also refer to attributes of referenced instances by using dot-notation.
Example conditions:
? "xpxTRUE? "
Equivalent to NULL or empty string.
? "(NAME LIKE JOHN%) AND (AGE > 30)? "
Maches Johnny and Johnatan if they are older than 30 years.
? "WIFE.MOTHER.DOG.NAME = Fido? "
Matches all men with a mother in law that owns a dog named Fido.
Note that references to the element it self may be done by the symbol SELF. A string comparing condition may therefore be written
? "SELF.LastName = SCHMIDT? "
or simply
? "LastName = SCHMIDT?"

4INTEGER

options

Not used.

5INTEGER

firstIndex

The aggregate index from which to start searching for matching instances.

6INTEGER

maxHits

Specifies the maximum number of matching instances to return.

7INTEGER

indexOfLastFound

The index of the last found matching instance element. This return value enables incremental search for matching elements. See example below.

8INTEGER

actualHits

The number of matching instances found.

9AGGREGATE OF GENERIC

foundInstances

Return value. A numeric aggregateID that uniquely identifies the volatile list that will contain the index of each matching instance.

...

Return Value

...

Insert excerpt
US:_r_XPX_Return_Value
US:_r_XPX_Return_Value
nopaneltrue

Options

...

 

Example

...

Code Block
languagecpp
firstIndex = 1;
maxHits := 10;
actualHits := maxHits;
 
WHEN (actualHits = maxHits);
BEGIN
indexList := xpfSelectAggrInstances(myAggrId,
"(NAME LIKE JOHN%) AND (AGE > 30)"
0, firstIndex, maxHits, lastMatch,
actualHits,);
 
(* Process matching elements here *)
 
firstIndex := lastMatch + 1;
END;
 

 

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "extension_schema" and parent = "5636522"