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 theParamText
procedure.
PROCEDURE ParamText (param0: Str255; param1: Str255; param2: Str255; param3: Str255);
param0
- A text string to substitute for the special string
^0
in the static text items of all subsequently created alert and dialog boxes.param1
- A text string to substitute for the special string
^1
in the static text items of all subsequently created alert and dialog boxes.param2
- A text string to substitute for the special string
^2
in the static text items of all subsequently created alert and dialog boxes.param3
- A text string to substitute for the special string
^3
in the static text items of all subsequently created alert and dialog boxes.DESCRIPTION
TheParamText
procedure replaces the special strings^0
through^3
in 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 inParamText
are 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
ParamText
in modeless dialog boxes. If a modeless dialog box usingParamText
is 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
ParamText
cannot contain the special strings^0
through^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,
ParamText
is 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 useParamText
to 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 useParamText
to 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
. TheSetDialogItemText
procedure also allows you to set or change the entire text string for a static text item.