Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 6 - Script Manager / Script Manager Reference
Routines / Replacing a Script System's Default Routines


SetScriptUtilityAddress

The SetScriptUtilityAddress procedure replaces the specified 1-byte script utility--or the original Roman utility--for the given script.

PROCEDURE SetScriptUtilityAddress (selector: Integer;
                                   before: Boolean;
                                   routineAddr: Ptr;
                                   script: ScriptCode);
selector
A value that specifies the name of the utility routine to be replaced.
before
A Boolean that specifies which of two routines is to be replaced. If TRUE, the WorldScript I implementation of the utility is replaced. If FALSE, the original routine (usually the built-in Roman version) is replaced.
routineAddr
A pointer to the routine that is to replace the script utility.
script
The numeric code that specifies the script system whose dispatch table contains the pointers to the utility routines. Constants for all defined script codes are listed on page 6-52.
DESCRIPTION
The SetScriptUtilityAddress procedure replaces the pointer to the desired routine in the specified script's dispatch table.

Several of the WorldScript I utilities call the original Roman routine after they execute. Each element in the dispatch table consists of a pair of addresses: one for the WorldScript I implementation of the utility, and another for the original (Roman) version of the utility. With SetScriptUtilityAddress you can replace either routine. Thus you can insert your patch code either before (or in place of) the WorldScript I version of the utility, or before (or in place of) the original Roman routine.

IMPORTANT
When you patch a script system's script utility, you alter that script's behavior for as long as it remains enabled. Therefore, be sure to restore the pointer to its original state whenever your application quits or is switched out by the Process Manager.
Valid values for the selector parameter are listed on page 6-101.

SEE ALSO
WorldScript I is described in the appendix "Built-in Script Support" in this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996