How to collect all of the iteration results? [message #1856334] |
Sun, 04 December 2022 17:37 |
Burak Karaduman Messages: 84 Registered: July 2018 |
Member |
|
|
Dear all,
Considering the below example, I would like to collect all the results of the if/else comparision in the iteration as OrderedSet. However, the iteration only produces the last element's result. Is it possible to capture the results of the each iteration?
helper context OclAny def: IterateEx(obj:P!P):OrderedSet(Boolean)=
let res: OrderedSet(Boolean) = OrderedSet{} in
res->including(obj.min->iterate(e; travel: Integer = 0 | (if (target<(obj.max->at(obj.min->indexOf(e))))and (target>e) then
true
else
false
endif
)));
Thank you.
[Updated on: Sun, 04 December 2022 17:39] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.01807 seconds