Scanf_color_defaultstr, Scanf_ctrl_scannerstatus – Argox PA-20 Programming Guide User Manual
Page 74
![background image](https://www.manualsdir.com/files/772043/content/doc074.png)
PT-20 Programming Guide
72
successfully read, converted, and saved in variables. A return value equal
to EOF means that an end-of-file was encountered during the read
operation.
Purpose: Use _scanf_color_DefaultStr to set a default string in input and read
character strings from the standard input file and covert the strings to
values of C variables according to specified formats.
Syntax: int _scanf_color_DefaultStr(int color, char* assDefaultStr, const char
*format, ...);
Example call:
char assBuffer[10] = “ABC”;
_scanf_color_DefaultStr(COLOR_RED, assBuffer , “%s”, assBuffer);
Includes:
#include “SDK.h ”
Description: The _scanf_color_DefaultStr function accepts a variable number of
arguments, which it interprets as addresses of C variables, and reads
character strings, representing their values. It converts them to their
internal representations using formatting commands embedded in the
argument format, which must be present in a call to
_scanf_color_DefaultStr.
The interpretation of the variables depends on the forma. The formatting
command for each variable begins with a % sign and can contain other
characters as well. A whitespace character (a blank space, a tab, or a new
line) may cause _scanf_color_DefaultStr to ignore whitespace
characters from keyboard. Other nonwhitespace characters, excluding
the % sign, cause _scanf_color_DefaultStr to ignore each matching
character from the input. It begins to interpret the first nonmatching
character as the value of variable that is being read.
For each C variable whose address is included in the argument list to
_scanf_color_DefaultStr, there must be a format specification embedded
in the format. For the complete format specification accepted by the
_scanf_color_DefaultStr function, please refer to the scanf function in
Turbo C++.
If you want input a float value, the value type is “ double “, not “ float “.
Returns: The _scanf_color_DefaultStr function returns the number of input items
that were successfully read, converted, and saved in variables. A return
value equal to EOF means that an end-of-file was encountered during the
read operation.
Purpose:
Set scanner on/off when use “_scanf_color” function.