12.07.2015 Views

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

IntroductionArrays provide a way of manipulating ordered sets of values referenced through an indexstarting from zero (0). Unlike arrays in other languages, <strong>ILOG</strong> Script arrays do not have afixed size and are automatically expanded as new elements are added. For example, in thefollowing program, an array is created empty, and new elements are then added.a = new Array() // Create an empty arraya[0] = "first" // Set the element 0a[1] = "second" // Set the element 1a[2] = "third" // Set the element 2Arrays are internally represented as sparse objects, which means that an array where only theelement 0 and the element 10000 have been set occupies just enough memory to store thesetwo elements, not the 9999 which are between 0 and 10000.238I L O G O P L D E V E L O P M E N T S T U D I O L A N G U A G ER E F E R E N C E M A N U A L

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!