## CONDEX | Welcome Gallery Handbook |
| Manual page for CONDEX(PL)

## CONDITIONAL EXPRESSIONS

Conditional expressions use a simple syntax made up of operators such as `=` and `!=`, operands, and logical connectors such as `&&` and `||`. Operands may be literal numeric, alphanumeric, or text string values, @variables, data field @numbers, or functions . In scripts , literal string operands may be enclosed in double quotes (").`` Parentheses have no special meaning in these expressions as there is no hierarchy of presidence.``

Note: in ploticus #if statements, variables should be preceded by one at-sign (@). In select attributes or getdata filter, variables should be preceded by two at-signs (@@).``

## EXAMPLES

- In a script , see if the value of the variable @SUM is greater than 100:

    	 #if @SUM > 100
    	...
    	 #endif

- Another example:

    	 #if @SUM > 100 && @STATUS = s

- Check to see if @description has any contents:

    	 #if $len(@description) > 0

- Check to see if @val is a valid number:

    	 #if $isnumber(@val) = 1

- See if @C does not countain a double quote:

    	 #if @C != "\""

Conditional expression for finding lastname beginning with `Gr`, `Gu` or `Gy`:

    	@lastname inlike Gr*,Gu*,Gy*

## OPERANDS

Operands may be

- @variables
- @field numbers, e.g. @1 = first data field
- Literal values (numbers, alphanumerics, text strings, commalists )
- Functions

In scripts , literal alphanumeric, text string, or commalist operands may be enclosed in double quotes ("); no variable evaluation occurs inside quoted strings.``

## COMPARISON OPERATORS

      = 	Equal to.  This is case sensitive for strings.
      !=	Not equal to.
      > 	Greater than.
      >= 	Greater than or equal to.
      <  	Less than.
      <= 	Less than or equal to.

  If at least one operand is non-numeric, comparison operators such as > will do an ascii value comparison.``

Wild card matching: Wild card matching may be done using like. Wild card characters are * which matches any number of any character, and ? which matches a single instance of any character. This matching is case-insensitive.``

      like	Wild card match.  Example: hello like h* (true)
      !like	Not a wild card match.

Commalist operators: these take a commalist on the right side.`` By default, lists are delimited using commas. If this is not convenient, the list delimitation character may be changed using #control listsep .``

      in	Member of list.  Example: z in x,y,z (true)
      !in	Not a member of list. (Alt: ni)
      inlike 	Same as in but wild card matching is used.
      		(Wild cards may be used in list members.)
      !inlike	Same as !in but wild card matching is used.

## LOGICAL CONNECTORS

Individual conditional expressions may be connected together using logical AND (&&) or OR (||).`` An entire expression may be negated by putting not: at the beginning of the expression.``

Because parentheses may not be used to establish presidence mixing AND and OR in the same expression requires care.`` When the expression is parsed, it is first split into OR terms, then each of the OR terms is split into AND terms.`` For example: `A = B and C = D or E = E of F = G` would evaluate to true, because it is interpreted as if it were written `(a = B and C = D) or (e = e) or (f = g)`.`` It may be best to avoid mixing AND and OR in the same expression and use multiple expressions instead.``

## LIMITATIONS AND BUGS

Because parentheses may not be used to establish presidence, the mixing of AND and OR in the same expression is problematic (see above).``
data display engine
Copyright Steve Grubb

Markup created by unroff 1.0, `` `` August 31, 2001.