Struct.value Method [AX 2012]
Gets or sets the value for a specified item in a struct.
An exception is raised if there is no item with the specified name in the struct. The name of an item in a struct may be retrieved by using the Struct.fieldName method.
You can add a new item to a struct and assign a value to it at the same time by using the Struct.add method. To assign a new value to an item based on its position in the struct, use the Struct.valueIndex method.
The following example creates a struct with two items in it and then uses the value method to assign values to those two items.
{
Struct s = new Struct ("str name; int age");
// Set the values
s.value("name", "Jane Dow");
s.value("age", 34);
// Print the values
print s.value("name");
print s.value("age");
pause;
}
Community Additions
ADD
Show: