Null object: Difference between revisions

Content added Content deleted
Line 95: Line 95:
=={{header|BBC BASIC}}==
=={{header|BBC BASIC}}==
{{works with|BBC BASIC for Windows}}
{{works with|BBC BASIC for Windows}}
A null object has a zero-value pointer.
A null object has a pointer with a value of zero or one.
<lang bbcbasic> DIM a(123)
<lang bbcbasic> PROCtestobjects
END
DEF PROCtestobjects
PRIVATE a(), b(), s{}, t{}
DIM a(123)
DIM s{a%, b#, c$}
DIM s{a%, b#, c$}
IF !^a() = 0 PRINT "a() is null" ELSE PRINT "a() is not null"
IF !^a() <= 1 PRINT "a() is null" ELSE PRINT "a() is not null"
IF !^b() = 0 PRINT "b() is null" ELSE PRINT "b() is not null"
IF !^b() <= 1 PRINT "b() is null" ELSE PRINT "b() is not null"
IF !^s{} = 0 PRINT "s{} is null" ELSE PRINT "s{} is not null"
IF !^s{} <= 1 PRINT "s{} is null" ELSE PRINT "s{} is not null"
IF !^t{} = 0 PRINT "t{} is null" ELSE PRINT "t{} is not null"</lang>
IF !^t{} <= 1 PRINT "t{} is null" ELSE PRINT "t{} is not null"
ENDPROC</lang>
'''Output:'''
'''Output:'''
<pre>
<pre>