Written by

Senior Cloud Architect at InterSystems
Question Eduard Lebedyuk · Jan 26, 2019

NULL placeholder in $List functions?

Today in docs I found this example using NULL:

 WRITE $LISTVALID($LB(NULL)),!

simplified

zzdump $LB(NULL)

and NULL can be case-insensitive:

zzdump $LB(null)

seems the same as just:

zzdump $LB()

But if null variable is defined then list would contain value from variable. Case sensitive in that situation.

Does anyone have any Idea what is this? Is NULL used anywhere besides as a list element?

Comments

Alexander Koblov · Jan 26, 2019

Null in this case is not a reserved word. It’s just a name of variable that is not defined.

0
Eduard Lebedyuk  Jan 27, 2019 to Alexander Koblov

Thank you,. Alexander.

Really didn't think that it could be any undefined variable.

0
Robert Cemper  Jan 26, 2019 to Robert Cemper

I'd personally prefer that $LB(var) also follows the elementary rules of COS.
Though I have no hope on any ProdLog on this subject

0
Robert Cemper · Jan 26, 2019

as pointed out by Alexander Koblov  already:

you can create a $LB() od $LB(undefined) and it's all the same

set a=$LB() zzdump a
0000: 01

or 

write $d(undefined)

0

set a=$lb(undefined) zzdump a

0000: 01

Your coincidence of NULL, null, Null, nuLL,  .... is just an optical eye-catcher without syntactical relevance in COS

0
Eduard Lebedyuk  Jan 27, 2019 to Robert Cemper

Thank you, Robert!

I'll file a prodlog (about the docs), so we'll see.

0