Replaces the element that is in the specified position with the provided element. Returns true if the operation succeeds.
&VarCollection1.Set(Numeric Index, Element)
Where:
&VarCollection1
The collection to which the method is applied to replace the specified element in the specified position.
Numeric Index
Indicates the position in the collection where you want to replace the existing element with a new element.
Element
The new element you want to place in the position specified by the Numeric Index.
Type Returned:
Boolean
Generator: .NET, .NET Framework, Java, Android
1)
// &NumericCollection1 = ("one", "two", "three")
&isOk = &NumericCollection1.Set(1, "newone")
The result is &NumericCollection1 = ("newone", "two", "three") &isOK=true.
2)
// &NumericCollection1 = ("one", "two", "three")
&isOk = &NumericCollection1.Set(10, "newone")
The result is &NumericCollection1 = ("one", "two", "three") &isOK=false.
3)
// &NumericCollection1 = ("one", "two", "three")
&isOk = &NumericCollection1.Set(0, "newone")
The result is &NumericCollection1 = ("one", "two", "three") &isOK=false.
This method is available since GeneXus 18 Upgrade 9.
AddRange method
RemoveRange method