Message strings

Message strings are used only within validators. Validators require these message strings for error messages.

The messages themselves usually consist of translatable strings stored as string objects in WinStudio's Strings table. We recommend that you use translatable strings wherever possible, so that they can change automatically when the user interface language changes.

Translatable strings used for error messages typically begin with a lower-case 'm'. This convention indicates to WinStudio to look for the corresponding message string in the Strings table.

Note: We recommend that you use names containing only alphanumeric characters, the underscore (_) character, and the percent sign (%), which is used for substitutions (see below). Alphanumeric characters include the letters a-z, either upper case or lower case, and the numerals 0-9.

When creating or using message strings, keep in mind that you can susbstitute various values in place of substitution keywords. At run time, then, WinStudio replaces the keyword with the substitution value. These are the substition keywords that WinStudio recognizes:

Substitution Syntax Description/Comments
%L Substitutes and displays the caption for the component in place of this keyword.

In the case of components that do not display their own captions, but rather display their labels in a Static component, this substitution keyword uses the caption of the Static component instead.

%V Substitutes and displays the value of the component in place of this keyword.
%p Substitutes and displays the value of another string that names a property.

This property string must use the syntax pPropertyName; that is, a lower-case 'p' followed by the name of the property being referenced.

Note: This syntax is normally used only when there is some ambiguity about a property's name in the form's context.
%o Substitutes and displays the value of another string that names a property of a specified object.

This property string must use the syntax oObject.Property; that is, a lower-case 'o' followed by the name of the object and property being referenced.

Note: This syntax is normally used only when there is some ambiguity about a property's name in the form's context.
%n where n is an integer Substitutes and displays the value of a parameter as specified by the component. These parameters are listed and referenced using the Edit Validators and Validator Properties dialog boxes.
%B Substitutes and displays an error message that is passed in from a validation stored procedure using a message type parameter. If the Exception text is Back End Msg parameter is selected, then this keyword must be included to view the exception message text.

These substitution keywords can be valuable in helping you reuse message strings in a variety of contexts without having to individually define each message.