Is zero the same as empty?

2014-10-27 Thread Graham Samuel
I found that if a parameter of a handler or function, or indeed a local variable, (say t1) has never had a value placed in it, then t1 = 0 is true. I was surprised by this, since I thought all unassigned variables were rendered empty by the engine, and that empty and zero were distinct.

Re: Is zero the same as empty?

2014-10-27 Thread J. Landman Gay
On 10/27/2014, 11:20 AM, Graham Samuel wrote: I found that if a parameter of a handler or function, or indeed a local variable, (say t1) has never had a value placed in it, then t1 = 0 is true. I was surprised by this, since I thought all unassigned variables were rendered empty by the

Re: Is zero the same as empty?

2014-10-27 Thread dunbarx
: Mon, Oct 27, 2014 12:21 pm Subject: Is zero the same as empty? I found that if a parameter of a handler or function, or indeed a local variable, (say t1) has never had a value placed in it, then t1 = 0 is true. I was surprised by this, since I thought all unassigned variables were rendered

Re: Is zero the same as empty?

2014-10-27 Thread Mark Wieder
J. Landman Gay jacque@... writes: Empty is sort of a Schrödinger variable and changes its state depending on how you look at it. Something similar occurs for true and false. I no longer check variables to see if they are false, because uninitialized variables being empty will fail the test.

Re: Is zero the same as empty?

2014-10-27 Thread dunbarx
to use LiveCode use-livecode@lists.runrev.com Sent: Mon, Oct 27, 2014 2:25 pm Subject: Re: Is zero the same as empty? On 10/27/2014, 11:20 AM, Graham Samuel wrote: I found that if a parameter of a handler or function, or indeed a local variable, (say t1) has never had a value placed

Re: Is zero the same as empty?

2014-10-27 Thread dunbarx
: Is zero the same as empty? I found that if a parameter of a handler or function, or indeed a local variable, (say t1) has never had a value placed in it, then t1 = 0 is true. I was surprised by this, since I thought all unassigned variables were rendered empty by the engine, and that empty

Re: Is zero the same as empty?

2014-10-27 Thread J. Landman Gay
On 10/27/2014, 1:48 PM, Mark Wieder wrote: Heisenvars. Nice. :) -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list

Re: Is zero the same as empty?

2014-10-27 Thread FlexibleLearning.com
As Jacque has pointed out, 'empty' and 'zero' depend on context. When doing math calculations, I always force a math evaluation... If t1 + 0 = 0 then ... If t1 is empty it will then always evaluate to zero. Might help in your situation. Best regards, Hugh Senior FLCo

Re: Is zero the same as empty?

2014-10-27 Thread dunbarx
, though one might think it should: on mouseUp do put b + 3 end mouseUp Craig -Original Message- From: J. Landman Gay jac...@hyperactivesw.com To: How to use LiveCode use-livecode@lists.runrev.com Sent: Mon, Oct 27, 2014 3:16 pm Subject: Re: Is zero the same as empty? On 10/27

Re: Is zero the same as empty?

2014-10-27 Thread dunbarx
, Oct 27, 2014 4:00 pm Subject: Re: Is zero the same as empty? As Jacque has pointed out, 'empty' and 'zero' depend on context. When doing math calculations, I always force a math evaluation... If t1 + 0 = 0 then ... If t1 is empty it will then always evaluate to zero. Might help in your

Re: Is zero the same as empty?

2014-10-27 Thread Peter Haworth
I ran across one situation involving zero/empty a while back that I reported as a bug, not sure if it's been fixed or not. If you INSERT a row into an SQL database and leave out some of the columns, those columns end up as NULL in the database (assuming they don't have a default value assigned in

Re: Is zero the same as empty?

2014-10-27 Thread Bob Sneidar
Message- From: FlexibleLearning.com ad...@flexiblelearning.com To: use-livecode use-livecode@lists.runrev.com Sent: Mon, Oct 27, 2014 4:00 pm Subject: Re: Is zero the same as empty? As Jacque has pointed out, 'empty' and 'zero' depend on context. When doing math calculations, I always