Null object: Difference between revisions
Content added Content deleted
(Added F# version) |
Walterpachl (talk | contribs) (→{{header|ooRexx}}: Extended the example and added output) |
||
Line 682: | Line 682: | ||
</lang> |
</lang> |
||
Uninitialized ooRexx variables do not evaluate to .nil, but rather the character string name of the variable (all uppercase). The var() built-in function allows variable validity to be tested: |
Uninitialized ooRexx variables do not evaluate to .nil, but rather the character string name of the variable (all uppercase). The var() built-in function allows variable validity to be tested: |
||
<lang ooRexx> |
<lang ooRexx>a=.array~of('A','B') |
||
i=3 |
|||
⚫ | |||
if a[i] == .nil then say "Item" i "of array A is missing" |
|||
⚫ | |||
⚫ | |||
if \var("var") then say "Variable" var "is not assigned"</lang> |
|||
Output: |
|||
<pre> |
|||
Item 3 of array A is missing |
|||
Variable INPUT is not assigned |
|||
Variable VAR is not assigned |
|||
⚫ | |||
=={{header|Oz}}== |
=={{header|Oz}}== |