|[Acceleo] 'If' on an Iterate loop [message #501304]
||Tue, 01 December 2009 19:31
Registered: November 2009
Is it possible to use an 'if' expression on a iterate loop?
I've saw this expression on OMG OCL documentation (page 145)...
result = self->iterate( elem; acc : Integer = 0 | if elem = object then acc + 1 else acc endif)
... and have tried to used the expression below:
[query hasList(m : MetaComponent) : Boolean =
m.relationship->iterate(item; res : Boolean = false | if item.highCardinalitie <> 1 then true endif ) /]
This expression has this error: 'then unexpected token'.
Is the sintax incorrect? Is there any other way to obtain this result?
Another question: is there any command similar to java 'Break', used to terminate a loop?
Powered by FUDForum
. Page generated in 0.02613 seconds