Display an expression or a string in the Console window.


PRINT "mask" ,expression1[,expression2,]

PRINT [/DBVAR=dbvar_name] "string"



The interpretation of the mask string follows the conventions defined by the ANSI C standard of the library function printf(). Additionally, if an integer format specifier (for example, “d” for decimal form) is prefixed with “ll”, the PRINT command uses the long long format. If a floating point format specifier (for example, “e”) is prefixed with “l”, the PRINT command uses the long double format. Some restrictions to the ANSI definitions for formatting requests apply:

The ‘#' flag is not supported.

The sequence “%n” is ignored, no expression argument should be given.


The expression or variable to be printed, for example, var2.


The string to be printed in the Console window.


Assigns string to the debugger variable dbvar_name. This option may be used to set a new debugger variable. The value of the debugger variable is displayed by EVALUATE @dbvar_name.


This command prints an expression with a specified mask or a string to the Console window. If a protocol file has been opened before, the output is also printed to this file. No output takes place until the newline symbol “\n” is encountered in mask or string. Subsequent calls of PRINT may be used to build up one line of output. In this case, no other command may be interspersed, because the previously stored output would be lost.


PRINT "Hello world\n"

See Also

For more complete information about compiler optimizations, see our Optimization Notice.