Re: newbie questions
- Posted by ghaberek (admin) Jul 01, 2013
- 1092 views
DerekParnell said...
There is a difference between an EMPTY sequence and an UNASSIGNED sequence. When a variable is declared, and if there is no initial assignment on the declaration statement, the variable has NO VALUE. It is unassigned. A sequence is not assigned by default to 'empty' when it is declared, but it is in a state called 'unassigned'.
sequence S_One sequence S_Two = {} sequence S_Three = {1,2,3} ? S_Three --> {1,2,3} ? S_Two --> {} ? S_One --> ** CRASH Sequence has not been assigned anything yet.
Also, you can also use object() to determine if a value is assigned or not.
sequence S_One sequence S_Two = {} ? object( S_One ) -- false ? object( S_Two ) -- true
-Greg