OCLOperators addReturnIndexOf0
Hans Karlsen (talk | contribs) (Created page with "The AddReturnIndexOf0 works like a normal Add - but returns the zero based position of the object added. This is particularly useful when dealing with innerlink objects - you...") |
(Automatically adding template at the end of the page.) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
The AddReturnIndexOf0 works like a normal Add - but returns the zero based position of the object added. | The AddReturnIndexOf0 works like a normal Add - but returns the zero-based position of the object added. | ||
This is particularly useful when dealing with innerlink objects - you add an object of Class2 to Class1.Class2s - and that results in a link object creation of Class3 | This is particularly useful when dealing with innerlink objects - you add an object of Class2 to Class1.Class2s - and that results in a link object creation of Class3. You can access the object of Class3 with an expression like: | ||
let x=self.Class2s.addReturnIndexOf0(Class2.Create) in | let x=self.Class2s.addReturnIndexOf0(Class2.Create) in | ||
( | ( | ||
self.Class3.at0(x).Attribute1:='Yes' | self.Class3.at0(x).Attribute1:='Yes' | ||
) | ) | ||
Or even more compact: | |||
self.Class3.at0(self.Class2s.addReturnIndexOf0(Class2.Create)).Attribute1:='Yes2' | |||
[[File:2022-10-26 11h56 42.png|none|thumb|350x350px]] | [[File:2022-10-26 11h56 42.png|none|thumb|350x350px]] | ||
[[Category:OCLOperators]] | |||
{{Edited|July|12|2024}} |
Latest revision as of 15:40, 10 February 2024
The AddReturnIndexOf0 works like a normal Add - but returns the zero-based position of the object added.
This is particularly useful when dealing with innerlink objects - you add an object of Class2 to Class1.Class2s - and that results in a link object creation of Class3. You can access the object of Class3 with an expression like:
let x=self.Class2s.addReturnIndexOf0(Class2.Create) in ( self.Class3.at0(x).Attribute1:='Yes' )
Or even more compact:
self.Class3.at0(self.Class2s.addReturnIndexOf0(Class2.Create)).Attribute1:='Yes2'
This page was edited more than 11 months ago on 02/10/2024. What links here