Clib.vprintf()
syntax: |
Clib.vprintf(formatString, valist) |
where: |
formatString - string that specifies the final format.
valist - a variable list of arguments to be used according to formatString.
|
return: |
number - number of characters written on success, else a negative number.
|
description: |
This method displays formatted output on the standard output stream, screen, using a variable number of arguments. This method is similar to Clib.printf() except that it takes a variable argument list using valist.
See Clib.printf() and Clib.va_start() for more information. The method Clib.vprintf() returns the number of characters written on success, else a negative number on error.
The example function acts just like a Clib.printf() statement except that it beeps, displays a message, beeps again, and waits a second before returning. This method could be a wrapper for the Clib.printf() method to display urgent messages.
|
see: |
Clib.printf(), Clib.va_start()
|
example: |
function UrgentPrintf(FormatString[ arg1 ...]) { // create variable arg list Clib.va_start(valist, FormatString); Screen.write("\a"); // audible beep // printf original statement var ret = Clib.vprintf(FormatString, valist); Screen.write("\a"); // beep again SElib.suspend(1000); // wait before returning Clib.va_end(valist); // end using valist return(ret); // return as printf would } } |