Skip to main content
PREV CLASS NEXT CLASS FRAMES NO FRAMES

 

Class IloTuple

IloTuple
Example:
tuple T {
  int i;
  string s;
}

T t1=<1,"one">;
execute {
  t1.i=2;
  t1.s="two";
  writeln("t1 = ",t1);
}
After execution the Scripting log shows:
t1 =  <2 "two">
Iterating properties:
Default behavior.
Index resolution:
Default behavior.
Available for:
all
OPL type:
T, where T is a declared tuple type

Method Summary
Method Attributes Method Name and Description
all
Returns the name of the field at position i.
all
Returns the number of fields of this tuple.
Method Detail
getFieldName
{string} getFieldName(i)
Returns the name of the field at position i.
Parameters:
i
Example:
for (var i =0; i < myTuple.getNFields(); i++) {
  var f = myTuple.getFieldName(i);
  writeln("field name ", f);
  writeln("field type ", typeof( myTuple[f]));
  writeln("field value ", myTuple[f]);
}
Returns:
The field name.
Available for:
all

getNFields
{int} getNFields()
Returns the number of fields of this tuple.
Returns:
The number of fields.
Available for:
all

©Copyright IBM Corp. 1987-2011.