Testing for numerics

Robert Sneidar bobs at twft.com
Mon Oct 9 16:21:35 EDT 2006

Hi Ken. With all due respect, your example would only work if I  
declared the global inside a script (and therefore every script that  
uses it). And then it would put null into the global regardless of  
what was in it before. That would be disastrous. You might say I  
could just check to see if anything was in it, but that leads us back  
to the original question, which is, how do I discern between a global  
that just got declared but has yet to have anything put into it, and  
a global that is simply empty at the moment. The answer of course, is  
you can't do that.

But thanks to all who wanted to help. I am just going to have to code  
around this by creating init flags throughout the code whenever a  
global was checked for null, and use those instead.

Bob Sneidar
IT Manager
Logos Management
Calvary Chapel CM

On Oct 8, 2006, at 10:27 AM, Ken Ray wrote:

> <snip>
> Actually, since the null value is supported, and since you can't  
> initialize
> a global with a value anyway (can't do "global myGlob = 4"), you'd  
> have to
> assign a value anyway, so why not null:
>     global gMyGlob
>     put null into gMyGlob

More information about the use-livecode mailing list