The syntax for if
and while
blocks looks like this:
if (expr
) {command list
}
while (expr
) {command list
}
An expression result is true if nonzero, false if zero. If the
expression begins with !
, the sense of the test
is reversed.
There is no provision for else
with
if
.
For a while
loop, make sure that the loop
includes some exit condition that eventually occurs. This can be
done by writing expr
so that it becomes
false at some point.
The allowable syntax for expr
is
$
,
var_name
!$
, a string
or integer, or
var_name
`
.
query
`
The opening {
(curly brace) must be separated
from the preceding )
(right parenthesis) by
whitespace, such as a space or a line break.
Variable references that occur within
`
are expanded
before the query is sent to the server for execution.
query
`