RAD Studio |  |

#pragma message
See Also
Collapse All

Syntax

Copy Code

    #pragma message ("text" ["text"["text" ...]])
    #pragma message text

Description

Use #pragma message to specify a user-defined message within your program code.

The first form requires that the text consist of one or more string constants, and the message must be enclosed in parentheses. (This form is compatible with Microsoft C.) This form will output the constant contained between the double quotes regardless of whether it is a macro or not.

The second form uses the text following the #pragma for the text of the warning message. With this form of the #pragma, any macro references are expanded before the message is displayed.

The third form will output the macro-expanded value of text following the #pragma, if it is #defined. If is not #defined, you'll get an ill-formed pragma warning.

User-defined messages are displayed as messages, not warnings.

Display of user-defined messages is on by default and can be turned on or off with the Show Messages option. This option corresponds to the compiler's -wmsg switch.

Messages are only displayed in the IDE if Show general messages is checked on the C++ Project Properties under ProjectOptionsProject Propertes.

See Also

Preprocessor Directives

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!