VarFormat-Strings.3w

Langue: en

Version: Jun 2009 (debian - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

Sommaire

NAME

VarFormat Strings

NOTES

When formatting a variant as a string, it is first converted to a VT_BSTR. The user-format string defines which characters are copied into which positions in the output string. Literals may be inserted in the format string. When creating the formatted string, excess characters in the string (those not consumed by a token) are appended to the end of the output. If there are more tokens than characters in the string to format, spaces will be inserted at the start of the string if the '@' token was used.

By default strings are converted to lowercase, or uppercase if the '>' token is encountered. This applies to the whole string: it is not possible to generate a mixed-case output string.

In user-defined string formats, the following tokens are recognised:

 Token  Description

 -----  -----------

 '@'    Copy a char from the source, or a space if no chars are left.

 '&'    Copy a char from the source, or write nothing if no chars are left.

 '<'    Output the whole string as lower-case (the default).

 '>'    Output the whole string as upper-case.

 '!'    MSDN indicates that this character should cause right-to-left

        copying, however tests show that it is tokenised but not processed.