Versions Compared

Key

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

...

Use this function to add an element instance to aggregate if the aggregate does not have an element with the same valueinstance.

xpfAddToAggrIfNotInAggr(aggr, element) performs for instances and aggregate of instances performs the same as the following statements:

IF NOT (element inst IN aggr) THEN aggr ++ elementinst; END_IF;

Arguments

...

TypeNameComment
AGGREGATE OF GENERICaggrIdcommentsaggregate of some instances, that requires to be unique
GENERICinstanceId instance id of new element 

Return Value

...

 

TypeNameComment
BOOLEANinserted  TRUE if the element was added

Options

...

 

Example

Code Block
languagecpp
LOCAL
	OK 	: BOOLEAN;
	str	: STRING;
	aggr: LIST OF STRING;
END_LOCAL;
...
str := 'QWERTY';
OK := xpfAddToAggrIfNotInAggr(aggr, str);
IF OK THEN
	xpxPrintf('\n%s inserted', str);
END_IF;
...

 

...

FUNCTION get_unique_references(referred: GENERIC): SET OF GENERIC;
     LOCAL
         not_unigue_refs : BAG OF GENERIC;
         unigue_refs : SET OF GENERIC;
     END_LOCAL;
     not_unigue_refs := USEDIN(referred,?);
     unigue_refs := [];
     REPEAT i:=1 TO xpfSizeOf(not_unigue_refs);
          IF xpfAddToAggrIfNotInAggr(unigue_refs, not_unigue_refs[i]) THEN
               xpxPrintf('\n%s inserted', not_unigue_refs[i].name);
          END_IF;
     END_REPEAT;
     RETURN(unigue_refs);
END_FUNCTION;

See also 

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

...