Do you mean a zero length string or a null (undefined) variable? They are very different things.

Setting the variable to "NULL" is neither zero length or undefined, it is a string who's value is the letters N+U+L+L.

 Quote:
Use an undefined variable (ie a $xxxx that hasnt been used before) and it will write NULL into the database.

There must be some way to control this so that a variable can be used to enter the null.


What's wrong with that? I use it myself when I've needed a real NULL value. You can declare the variable as long as you never assign anything to it.

In this example I declare a variable called $NULL and use it wherever I need a NULL value:

 Code:
Global $NULL
Dim $FOO

"Settiing $$FOO..."+@CRLF
$FOO="bar"
"$$FOO now has a type of "+VarTypeName($FOO)+@CRLF

"Resetting $$FOO..."+@CRLF
$FOO=$NULL
"$$FOO now has a type of "+VarTypeName($FOO)+@CRLF