safeGlobal

  where to store a global object reference so it will survive a clearglobals?
globals clearglobals




  hiding a global
version is "safe" and can be set.

However, another place to store globals as object properties 
is the alert hook. 

-- parent script alert hook obj 
-- hides variables 

property myLpVars

on new me 
  return me
end new

on alertHook me, err,msg  
  put err,msg  
  return -- 1 
end

on setVar me,dProp,dVal
  if voidP(myLpVars) then set myLpVars = [:]
  setaProp myLpVars,dProp,dVal
end

on getVar me, dProp
  return getaProp(myLpVars,dProp)
end

--------------------

-- Welcome to Director --

set the alertHook = new(script "alertHookObj")

setVar the alerthook,#test,#versuch

clearglobals

put getVar (the alertHook,#test)
-- #versuch

Home shock + cgi Bits 'n pieces Director Lingo Shocklets Contact










pageID=l_safeGlobal