private handlers in a public library

Dave dave at looktowindward.com
Thu Dec 7 06:08:48 CST 2006


Hi,

I use a different technique:

local sgLibraryExecuteFlag  --As a "Script Global"

in PrivateFunctionOrHandler:

if sgLibraryExecuteFlag <> kLibraryExecute  then return ERROR

In Public API functions/handlers:

function LibXXXAPICall
put kLibraryExecute into sgLibraryExecuteFlag

-- Do whatever

put empty into sgLibraryExecuteFlag
return
end LibXXXAPICall

All the Best
Dave

On 7 Dec 2006, at 01:24, Dick Kriesel wrote:

> 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
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list