Metrologic Optimus S Programming Manual page 93

"c" programming guide
Table of Contents

Advertisement

For any of the above displays, when ICON_ZONE is enabled, the entire screen
will be erased after calling clr_scr().
Note that the system may still show the status icons in this icon area, even
though ICON_ZONE is enabled. This is because these status icons are
constantly maintained by the system, and they may override the printing of
characters from time to time.
Return
None
printf
Purpose
To write character strings and values of C variables in a specified format to the
LCD.
Syntax
int printf (char *format, var...);
char *format;
var...;
Example
pritnf ("ID: %s", id_buffer);
Description
This routine accepts any variable and prints its value to the LCD. The value of
each variable is formatted according to the codes embedded in the format
specification format.
To print values of C variables, a format specification must be embedded in
format for each variable to be printed. The format specification for each
variable has the following form:
%[flags][width].[precision][size][type]
Field
% (required)
flags (optional)
width (optional)
precision (optional) A number that indicates how many characters, at
size (optional)
Chapter 3 Terminal Specific Function Library
/* character string that describes the format to be used */
/* any variable whose value is being printed on the LCD */
Explanation
Indicates the beginning of a format specification. Use
%% to print a percentage sign.
One of more of the '-', '+', '#' characters or a blank space
specifies justification, and the appearance of plus/minus
signs in the values printed (see below).
A number that indicates how many characters, at
maximum, must be used to print the value.
maximum, can be used to print the value.
When printing integer variables, this is the minimum
number of digits used.
A character that modifies the type field which comes
next. One of the characters 'h', 'l', and 'L' can appear in
this field to differentiate between short and long
integers. 'h' is for short integers, and 'l' or 'L' for long
integers.
87

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents