uniFPrintfPL()
Writes to a file similar to uniFPrintf() except changes to the current WinCC OA language before converting.
Synopsis
int uniFPrintfPL(file file, string format, [,<type1> var1
[,<type2> var2 ...]] );
Parameters
Parameter | Description |
---|---|
file | File to be written. Use the constants stdin, stdout, stderr (see Reference Tables). |
format | output format |
var1, var2, ... | arguments |
Return value
In the event of errors, the function returns -1 or EOF otherwise, the number of written characters.
Errors
If incorrect data types are used or if a file is not open.
Description
Writes to a file similar to uniFPrintf() except changes to the current WinCC OA language before converting. For the format, see chapter uniFPrintf().
Example
The following example writes the Russian texts to two files.
const int STRING_COUNT = 2;
main()
{
int i,j;
file f, f1;
dyn_string russianValue;
russianValue =makeDynString("русский","буcква");
DebugN("Russian letters:", russianValue);
//Opens two files for writing and reading
f=fopen("C:/TEMP/tfile.TXT","w+");
f1=fopen("C:/TEMP/tfile2.TXT","w+");
//writes string values to the text file
for (i=1;i<= STRING_COUNT;i++) uniFPrintfPL(f,"%.5s\n",
russianValue [i]); //Сut the string to a length of 5 letters
for (j=1;j<= STRING_COUNT;j++) fprintf(f1,"%.5s\n",
russianValue [j]);//The text is not correctly written since
fprinft is used
fclose(f);
fclose(f1);
}
Assignment
String functions
Availability
CTRL