Sunil Katti

Declaring and initializing arrays in a single SRL statement.

Discussion created by Sunil Katti on Mar 9, 2012
Latest reply on Mar 26, 2012 by Sunil Katti

Hi,

I wanted to know if we had a simple way of initializing arrays in SRL like -

aStrArray is an array of string initially {"abc", "pqr"}.

 

I know this works in SRL

aStrArray is an array of string initially {it[0] = "abc", it[1] = "pqr"}.

It would be nice not to mention the it[] everytime. There are places where I have had to write enormous initialization statements and having it simple helps.

Also, the above statement, that works in SRL, will not work when I am putting it in a variable. I always received an " 'it' does not refer to any object in this context" error message. Appreciate if someone could shed light on that as well.

 

Thanks in advance,

Rgards,

Sunil.

Outcomes