Prints formatted output to the standard output stream.
Syntax: |
---|
DlxApp.Printf(format, ...) |
Parameters
Parameter | Description |
---|---|
format | Format string. To display an icon, specify one of the following values at the beginning of the format string: ICONSPACE, ICONINFORMATION, ICONQUESTION, ICONWARNING, ICONERROR, ICONCHECKOUT, ICONDELETE. |
... | Optional arguments. |
Return Value
If an error occurs it returns false otherwise it returns true.
Remarks
The printf function formats and prints a series of characters and values to the standard output stream. If arguments follow the format string, the format string must contain specifications that determine the output format for the arguments.
The format argument consists of ordinary characters, and (if arguments follow format) format specifications. The ordinary characters are copied to output in order of their appearance.
Format specifications always begin with a percent sign (%) and are read left to right. When printf encounters the first format specification (if any), it converts the value of the first argument after format and outputs it accordingly. The second format specification causes the second argument to be converted and output, and so on. If there are more arguments than there are format specifications, the extra arguments are ignored. The results are undefined if there are not enough arguments for all the format specifications.
For more information, see Format Specifications.
Example
Copy code | |
---|---|
var count = 0;
var prjname = "prj1";
var prj = DlxApp.GetJob().GetProject(prjname);
if (prj.IsValid())
{
var items = prj.GetChildCount();
for (var index = 0; index < items; index++)
{
if (prj.GetChildItem(index).GetItemType() == DlxApp.ITEMID_DOCUMENT)
count++;
}
}
DlxApp.Printf("ICONINFORMATIONThe %s project includes %i documents.", prjname, count);
|