private handlers in a public library

Dick Kriesel dick.kriesel at mail.com
Wed Dec 6 20:24:14 EST 2006


What are the best practices for hiding private handlers in a public library?

I Googled "'private handler' site:lists.runrev.com" and similar terms
without finding the answer.  If the topic's been covered and I missed it,
please excuse me.

Here's a technique that uses the executionContexts:

on privateHandlerInPublicLibrary
  if item 1 of line -2 of the executionContexts is long id of me then
    return the params && the long time -- i.e., "private" stuff
  else pass privateHandlerInPublicLibrary
end privateHandlerInPublicLibrary

function privateFunctionInLibrary
  if item 1 of line -2 of the executionContexts is long id of me then
    return the params && the long time -- i.e., "private" stuff
  else pass privateFunctionInLibrary
end privateFunctionInLibrary

getprop uPrivatePropertyInLibrary
  if item 1 of line -2 of the executionContexts is long id of me then
    return the params && the long time -- i.e., "private" stuff
  else pass uPrivatePropertyInLibrary
end uPrivatePropertyInLibrary

setprop uPrivatePropertyInLibrary
  if item 1 of line -2 of the executionContexts is long id of me then
    return the params && the long time -- i.e., "private" stuff
  else pass uPrivatePropertyInLibrary
end uPrivatePropertyInLibrary

Object backScripts would make it simpler, but what's best now?

-- Dick





More information about the use-livecode mailing list