Originally, certain keywords were required to be surrounded by dots, but at some point that requirement went away. NULL is one example of that. Others include AND, OR and NOT.
So just use whichever form you prefer.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Bear in mind that the Properties window treats null and .null. differently: a property initialized as .null. is set to .NULL., whereas a property initialized as null or NULL or Null is set to a string ("null", "NULL", or "Null", ...). To use the dotless notation, you have to prepend the property value with an equal sign (that is, = null).
To round this up: VFP still needs dots for .T. and .F., obviously, while you can use null in code, t and f would be interpreted as variable or workarea or field names, especially f. As null was introduced as a synonym for .NULL. they didn't made the same step for true and false, though.
Because of these details I would opt to still write .NULL. anywhere you mean that boolean special value, except that the ISNULL() function can't be addressed as IS.NULL.(), of course.
I don't apply that rule of thumb to still use the dots with .AND. and .OR. and use the normal AND/OR operators, even though you can use AND and OR as variable names! While the dots around them make it expressively boolean operators and not names of variables, workareas or anything else, there's no problem to identify what's meant. Even though you can have a variable AND=42, the code IF foo=bar AND AND=42 still will work out fine and there is no way the AND in the middle of the IF expression is mistaken for the variable or the variable after it is mistaken for the boolean AND operator. It's the context/semantics that make it clear what each AND in that IF expression means, no need for dots. I'm sure someone can come up with some example where that would matter, but another rule of thumb therefore is to not use keywords as names of anything. Simply to not confuse yourself when reading the code.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.