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.
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
: 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
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.
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
: 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
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
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
, 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
, 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
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
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
12 matches
Mail list logo