use "" as an array key
Peter TB Brett
peter.brett at livecode.com
Sat Sep 24 03:35:03 EDT 2016
On 24/09/2016 04:26, Kay C Lan wrote:
> On Fri, Sep 23, 2016 at 2:27 AM, Peter TB Brett
> <peter.brett at livecode.com> wrote:
>>
>> "" isn't "the absence of a string", it's a string that's 0 characters long.
>> Being able to use it as an array key is important for being able to
>> represent real-world data in an array.
>
> It's an important point that "", a 0 character string is not the same
> as NULL because we as humans often 'see them' as the same.
Very confusingly, "null" in LiveCode Script is _not_ the same as "NULL"
in SQL.
In LiveCode, "null" is shorthand for "numtochar(0)".
LiveCode Script doesn't really have the concept of "no value at all"
that is modelled by SQL's "NULL". Most of the syntax fakes it by using
the empty string, but unfortunately that doesn't work everywhere.
LiveCode Builder has "nothing", which is a proper "no value".
Peter
--
Dr Peter Brett <peter.brett at livecode.com>
LiveCode Technical Project Manager
lcb-mode for Emacs: https://github.com/peter-b/lcb-mode
More information about the use-livecode
mailing list