XML Script logo
Function _OP_NOT
Name

_OP_NOT

Returns

number

Parameter count

1

Parameter 1

operand, a string

Description

Returns 1 (true) if 'operand' evaluates to false, and 0 (false) otherwise.
An operand will evaluate to false if it equals the single character "0" or the null string "" e.g.
1 # ! "" # returns 1
2 # ! "0" # returns 1
3 # ! "0 " # returns 0
4 # ! " 0" # returns 0
5 # ! "0.0000" # returns 0
6 # ! "1" # returns 0
7 # ! "foo" # returns 0
8 # ! 0 # returns 1
9 # ! 0.0000 # returns 1
10 # ! 1 # returns 0
To get round the apparent problem in 3,4 use the following
# " 0" == 0 # returns 1

Examples of use

                                
                        

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited