beautypg.com

ProSoft Technology ProSoft i-View User Manual

Page 55

background image

ProSoft i-View ♦ Mobile Process Monitoring and Control Application

Data Source Files

Version 2.0.2

User Manual

ProSoft Technology, Inc.

Page 55 of 106

September 29, 2011

FORMAT
SPECIFIER

Description

format
attribute
support

to_s
method
support

format
function
support

o

Octal integer

NO

YES

YES

s

String or any object converted
using to_s

NO

YES

YES

u

Unsigned decimal integer

YES

YES

YES

x

Hexadecimal integer (e.g., 39ff)

YES

YES

YES

X

Hexadecimal integer (e.g.,
39FF)

YES

YES

YES

For the meaning and possible contents of the optional flags, width, and precision
fields refer to the sprintf specification:

http://www.cplusplus.com/reference/clibrary/cstdio/sprintf/

Note that since there is no need for it the length field is not available

The if then else clause and the ternary conditional operator

Two forms of conditional execution are provided:

The ternary conditional operator provide conditional execution of expressions. Its syntax
is the following:

expr ? expr1 : expr2

Returns expr1 if expr is not zero (true) or expr2 otherwise.

The if then else clause provide conditional choice of expressions. It is used as follows:

if expr [then] expr1 [else expr2] [end]

Executes expr1 if expr is not zero (true). If expr is zero (false) expr2 is executed instead.
Items between brakets are optional.