Null object: Difference between revisions

Content added Content deleted
(Added BBC BASIC)
Line 99: Line 99:
DIM s{a%, b#, c$}
DIM s{a%, b#, c$}
IF !^a() PRINT "a() is defined" ELSE PRINT "a() is not defined"
IF !^a() = 0 PRINT "a() is null" ELSE PRINT "a() is not null"
IF !^b() PRINT "b() is defined" ELSE PRINT "b() is not defined"
IF !^b() = 0 PRINT "b() is null" ELSE PRINT "b() is not null"
IF !^s{} PRINT "s{} is defined" ELSE PRINT "s{} is not defined"
IF !^s{} = 0 PRINT "s{} is null" ELSE PRINT "s{} is not null"
IF !^t{} PRINT "t{} is defined" ELSE PRINT "t{} is not defined"</lang>
IF !^t{} = 0 PRINT "t{} is null" ELSE PRINT "t{} is not null"</lang>
'''Output:'''
'''Output:'''
<pre>
<pre>
a() is defined
a() is not null
b() is not defined
b() is null
s{} is defined
s{} is not null
t{} is not defined
t{} is null
</pre>
</pre>