Performs a bit-wise NOT of a value.
Syntax
$not(char)
Parameters
| char | a character string, or an expression that evaluates to a character string |
Return Value
Character string.
Comments
The $not function reverses the bit pattern of a single character in the fashion of a Boolean NOT and returns the resulting character.
If the char string contains more than one character, only the first character in the string (one byte) is processed. Char can be expressed as a hex code.
Example
$not("E")The bit pattern of hex 0E is 00001110. The above expression reverses the bit pattern to 11110001 (hex F1).
See Also
$and
$or
About Character Literals
About Functional Expressions
Returns the larger of a pair of numbers.
Syntax
$maxof(number1,number2)
Parameters
| number1 | a number or an expression that evaluates to a number |
| number2 | a number or an expression that evaluates to a number |
Return Value
The value returned by $maxof has the same number of decimal places as the number that is returned.
Comments
The function returns the larger of a pair of numbers.
Example
if event.eventname = "up"
let IndexPtr = $maxof(IndexPtr-1, 1)
else
... other commands ...
endif
Modifies an array index, without letting the index drop below 1.
See Also
$minof
About Functional Expressions
Returns the length of a character string.
Syntax
$length(string)
Parameters
| string | a character string or an expression that evaluates to a character string |
Return Value
Number.
Comments
If string is a complex arithmetic expression, then the result of $length(string) is always 17. Arithmetic expressions are evaluated using the data type vastint so that the largest possible number can always be handled. When converted to a string, a vastint value occupies 17 positions, regardless of its numeric value.
Example
$length("abcdefgh")Evaluates to 8.
$length(5*3)
Evaluates to 17.
Returns the smaller of a pair of numbers.
Syntax
$minof(number1,number2)
Parameters
| number1 | a number or an expression that evaluates to a number |
| number2 | a number or an expression that evaluates to a number |
Return Value
The value returned by $minof has the same number of decimal places as the number that is returned.
Comments
The function returns the larger of a pair of numbers.
Example
if event.eventname = "down"
let IndexPtr = $minof(IndexPtr+1, ArrayLen)
else
... other commands ...
endif
Modifies an array index, without letting the index exceed the specified number.
See Also
$maxof
About Functional Expressions
Tests if a number is odd.
Syntax
$isodd(expression)
Parameters
| expression | a number, or an expression that evaluates to a number |
Return Value
If expression evaluates to an odd number, the function returns “1” ($True); if expression evaluates to an even number, the function returns”0″ ($False)
If expression does not evaluate to a number, the software raises an error. The function returns “0” ($False).
Comments
Expression is rounded before testing.
Example
$isodd(vAmount)=$False
Evaluates to $True if vAmount is even.
$isodd(-5)
Evaluates to $True.
$isodd(Salary*1.1)
Evaluates to $False if Salary is 20,000.
$isodd("123.4")Evaluates to $True.
$isodd("abc")Evaluates to $False.
See Also
$isnumber
About Functional Expressions
Extracts the month number associated with a specified date value.
Syntax
$month(date)
Parameters
| date | a data, or an expression that evaluates to a date, in the form YYYYMMDD |
Return Value
Character string.
Comments
This function extracts month information from standard date values. Date is often the system variable $Date.
Example
$month(19931225)
Evaluates to “12”.
$month($date+7)
Evaluates to “1” when $Date is 19991225.
See Also
$addmonths
$Date
$day
$dayname
$monthname
$weekday
$year
About Data Types
About Functional Expressions
Tests if a character string contains only digits.
Syntax
$isdigit(string)
Parameters
| string | a character string or an expression that evaluates to a character string |
Return Value
1-character binary string. Evaluates to 1 ($True) if string meets the validation test; otherwise, evaluates to 0 ($False).
Comments
This function tests if a particular character string is all digits.
Example
$isdigit("0123")Evaluates to $True.
$isdigit(2.3)
Evaluates to $False.
See Also
$isalphabetic
$isalphanumeric
$isdate
$islower
$isnumber
$isupper
$iszimname
About Character Literals
About Functional Expressions
Syntax
SET TRANSACTION DEFAULTTYPE READ|NORMAL
Comments
This command is ignored by Zim 9.
Make Zim Server generate implicit transactions.
Syntax
SET IMPLICITTRANS OFF | ON
Comments
This command is ignored and has no effect on Zim Server. It is only accepted for backward compatibility.
Syntax
SET TIMEOUT time
The SET TIMEOUT sets a timeout amount for the FILEPATH options PORT and CONNECTOR in the command SET INPUT.
Comments
By default, the time is set to zero.
For historical reasons, the value of time must be specified in tenths of a second, that is, for 5.5 seconds, it should say 55.
When opening a document for input with SET INPUT with above options, any subsequent statements referring the specified document will terminate if not satisfied within the time interval specified by time.
Example
set timeout 55
set input stdin filepath "connector://localhost:2333"
list 10 stdin
If the LIST statement is not satisfied within 5.5 seconds, the LIST is terminated.