sprintfWithPointer

Copies the format string to the destination string with the format filled out as specified.

Thread Context:Non-Blocking

Syntax

    void sprintfWithPointer (
       BYTE  *destinationString,
       void  *controlString,
       void  *argumentVector
    );
    
    

Parameters

destinationString
(OUT) Points to the final string (formatted as specified).
controlString
(IN) Points to a string of formatting characters (as specified by ANSI C).
argumentVector
(IN) An array of LONGs that correspond to the formatting of controlString. One LONG for each formatting character.

Remarks

As argument tokens are detected in the control string, the corresponding argument is extracted from the argument vector, and a string representation of that argument is inserted in the destination string (in place of the argument token).

Each argument in the argument vector is a 32-bit object. Each element of this vector is cast differently, as it is extracted, depending on the corresponding token that is detected in the control string.

For tokens indicating double LONG numeric values, the two adjacent 32-bit objects are treated as the double LONG value. The first 32-bit value represents the least significant 32-bit portion, and the second 32-bit value represents the most significant 32-bit portion.

For string tokens, the corresponding 32-bit object is cast as pointer to BYTE.

Example

The following example demonstrates sprintfWithPointer:

    BYTE dString[256];
    LONG vector[3];
    
    vector[0]=(LONG) "George";
    vector[1]=48;
    vector[2]=0x12345;
    sprintfWithPointer(dString, "Hello, %s. You are %d and your code is %08X\r\n", vector);
    OutputToScreen(screenHandle, dString);