Important: The information in this document is obsolete and should not be used for new development.
ParamText
To substitute text strings in the static text items of your alert or dialog boxes while your application is running, use theParamTextprocedure.
PROCEDURE ParamText (param0: Str255; param1: Str255; param2: Str255; param3: Str255);
param0- A text string to substitute for the special string
^0in the static text items of all subsequently created alert and dialog boxes.param1- A text string to substitute for the special string
^1in the static text items of all subsequently created alert and dialog boxes.param2- A text string to substitute for the special string
^2in the static text items of all subsequently created alert and dialog boxes.param3- A text string to substitute for the special string
^3in the static text items of all subsequently created alert and dialog boxes.DESCRIPTION
TheParamTextprocedure replaces the special strings^0through^3in the static text items of all subsequently created alert and dialog boxes with the text strings you pass as parameters. Pass empty strings (notNIL) for parameters not used.SPECIAL CONSIDERATIONS
The strings used inParamTextare stored in the low-memory global variableDAStrings, which specifies a set of string handles used by the Dialog Manager.
If the user launches a desk accessory in your application's partition and the desk accessory callsParamText, it may change the text in your application's dialog box.You should be very careful about using
ParamTextin modeless dialog boxes. If a modeless dialog box usingParamTextis onscreen and you display another dialog box or alert box that also usesParamText, both boxes will be affected by the latest call
toParamText.The strings you pass in the parameters to
ParamTextcannot contain the special strings^0through^3, or else the procedure will enter an endless loop of substitutions in versions of system software earlier than 7.1.Note that you should try to store text strings in resource files to facilitate translation into other languages; therefore,
ParamTextis best used for supplying text strings, such as document names, that the user specifies. To avoid problems with grammar and sentence structure when you localize your application, you should useParamTextto supply only one text string per screen message.SEE ALSO
Listing 6-9 on page 6-47 and Listing 6-10 on page 6-48 show an example of how you can useParamTextto supply the title of the user's current document to your alert and dialog boxes. If you need to supply a default text string to an editable text item while your application is running, useSetDialogItemText. TheSetDialogItemTextprocedure also allows you to set or change the entire text string for a static text item.