Problem with zeros in lookup table

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


if (tVar is a number) then...
 
erik at erikhansen.org http://www.erikhansen.org


----- Original Message ----
From: Ken Ray <kray at sonsothunder.com>
To: Use Revolution List <use-revolution at lists.runrev.com>
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 maseurope.net> 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: http://www.sonsothunder.com/
Email: kray at sonsothunder.com


_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


 
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com



More information about the use-livecode mailing list