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.

Array constructorThe array constructor has two distinct forms.Array constructorSyntaxnew Array(length)EffectReturns a new array of length length with its elements from 0 to length-1 setto null.If length is not a number, and its conversion to a number yields NaN, the secondsyntax is used.Examples:new Array(12) -> an array a with length 12 and a[0] to a[11] containing null. newArray("5") -> an array a with length 5 and a[0] to a[4] containing null. newArray("foo") see second syntax.new Array(element1,..., elementn)Returns a new array a of length n with a[0] containing element1, a[1]containing element2, and so on. If no argument is given, that is n=0, an emptyarray is created. If n=1 and element1 is a number or can be converted to anumber, the first syntax is used.Examples:new Array(327, "hello world") -> an array a of length 2 with a[0] == 327 and a[1]== "hello world". new Array() -> an array with length 0. new Array("327") see firstsyntax.I 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 L239

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

Saved successfully!

Ooh no, something went wrong!