Printf


The global Printf function writes formatted text in a default CTextView window named Script Messages. This method provides functionality like the printf function in the C language. The Script Messages window is automatically created if it does not already exist.

Syntax

bOK = Printf( sFmt, ... )

bullet.gif    sFmt is a format string.

bullet.gif    ... refers to an optional list of arguments (see Remarks).

bullet.gif    On success, this method returns true.

bullet.gif    On failure, this method returns false.

Remarks

Printf takes 1 or more arguments. The first argument is a string that may be either the value to print or a format to be used for interpreting any additional arguments. Additional arguments provide values for the % fields embedded in the format string. The syntax of this function is compatible with the printf function in C; for details about specifying the format string, refer to documentation for printf in the C or C++ language.

Example

The script below writes formatted text to the Script Messages window using the Printf method:

s = "My string" ; n = 12.553

-- values to print

Printf("'%s': v=%-12lg\n", s, n/2.1 ))

-- do a formatted print

Related Topics

Wprintf, CFile:Printf, CTextView:Printf, Sprintf


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.