Testing for numerics

FlexibleLearning at aol.com FlexibleLearning at aol.com
Thu Oct 5 05:42:28 EDT 2006


Declaring initialised globals is not supported, so "global gAGlobal" is  
fine, but "global gAGlobal=empty" throws an error.
 
I can think of three ways to accomplish this:
 
Test against prior usage...
  if "gAGlobal" is not among the items of the globals then
    global gAGlobal
    put 10 into gAGlobal
  end if
 
Test against contents...
  global gAGlobal
  if gAGlobal <>"" then put 10 into gAGlobal
 
ReInitialize...
  delete global gAGlobal
  global gAGlobal
 
 
/H
 

> Robert, though this has nothing to do with type-checking, you  can  
> initialise variables to whatever you like when you declare  them, so
>
> global gAGlobal = empty


>>I for one would like to be able to have the  
>>  option of having new global variables initialized with NULL or   
>> UNDEFINED or something, so that I can check for the first  time  
>> initialization of said  variables.



More information about the use-livecode mailing list