Concise Variables

Thomas Gutzmann thomas.gutzmann at gutzmann.com
Sun Feb 6 08:53:59 EST 2005


Am 06.02.2005 um 11:31 schrieb Scott Rossi:

> If I change the variables to globals, the values will be persistent, 
> but
> I'll have to declare the global names everywhere in the script, which 
> is
> going to be a major chore in a 1700+ line script that has around 70
> handlers, not all of which require the globals.

You can put the global definition on top of the script; then it's valid 
for all handlers, like in the following snippet:

global gDB
global gLanguage

function checkCanDelete aTableName, aValue
   put false into vRC
   put "select f_has_children('" & aTableName & "' ,'" & aValue & "')" 
into vSQL
   put revDataFromQuery(,,gDB, vSQL) into vResult
...

Cheers,

Thomas G.



More information about the Use-livecode mailing list