Problem with zeros in lookup table

Erik Hansen erikhans08 at
Thu Nov 23 02:00:38 EST 2006

if (tVar is a number) then...
erik at

----- Original Message ----
From: Ken Ray <kray at>
To: Use Revolution List <use-revolution at>
Sent: Wednesday, November 22, 2006 7:45:36 PM
Subject: Re: Problem with zeros in lookup table

On 11/22/06 8:08 PM, "Mark Smith" <mark at> wrote:

> I don't know what a stanine score is, or how you're organizing your
> scores, but you might want to put code in to check whether or not the
> raw score is empty, zero or whatever. Sometimes in Revolution you can
> include an empty variable in a numerical calculation and still get a
> numerical result, rather than an error.

That's a good point. Many times I need to check if a variable is empty or 0
and take the same action. One *could* write it this way:

  if (tVar = 0) or (tVar = "") then

but another (shorter way) is:

  if (tVar + 0) = 0 then

This way, if tVar is 0 or empty, it ends up becoming 0 (empty + 0 = 0).

Ken Ray
Sons of Thunder Software, Inc.
Web site:
Email: kray at

use-revolution mailing list
use-revolution at
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.

More information about the Use-livecode mailing list