-
Notifications
You must be signed in to change notification settings - Fork 0
man ++
Jean-Raphaël GAGLIONE edited this page Dec 22, 2017
·
12 revisions
++
- increment a variable by one
++ VAR [MIN] [MAX]
Increment a variable by one.
If bounds are specified, switch to modular arithmetic, and the variable will iterate within the boundaries.
The second bound is set to zero if not given.
An unset variable will be set to the least bound if the last one is defined.
With boundaries given, when the variable (re)start a cycle the error code 255 is returned (instead of 0). This let you chain the commands with ||
.
VAR
: the incremented variable
MIN
, MAX
: range boundaries (order does not matter)
0
: if OK and no revolution
1
: if invalid parameters
2
: if previous value is inconsistent
255
: if OK and revolution (modular arithmetic)
++ SECOND 59 || ++ MINUTE 59 || ++ HOUR 23