Campbell CR800 Especificaciones Pagina 107

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 324
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 106
Section 4. CRBasic - Native Language Programming
The CR800 expression evaluator evaluates the expression, X>=5, and returns -
1, if the expression is true, and 0, if the expression is false.
W=(X>Y)
will set W equal to -1 if X>Y or will set W equal to 0 if X<=Y.
The CR800 uses -1 rather than some other non-zero number because the and
and or operators are the same for logical statements and binary bitwise
comparisons (see and and or in Section 8). The number -1 is expressed in
binary with all bits equal to 1, the number 0 has all bits equal to 0. When -1 is
anded with any other number the result is the other number, ensuring that if the
other number is non-zero (true), the result will be non-zero
4.7 Flags
While any variable can be used as a flag as far as logical tests in CRBasic are
concerned, it is best to use Boolean variables. If the value of the variable is
non-zero the flag is high. If the value of the variable is 0 the flag is low
(Section 4.6). Boolean variables can only have one of two values, true (-1) or
false (0).
4.8 Parameter Types
Instruction parameters allow different types of inputs. These types are listed
below and specifically identified in the description of the parameter in the
following sections or in CRBasic help.
Constant
Variable
Variable or Array
Constant, Variable, or Expression
Constant, Variable, Array, or Expression
Name
Name or list of Names
Variable, or Expression
Variable, Array, or Expression
Table 4.8-1 lists the maximum length and allowed characters for the names for
Variables, Arrays, Constants, etc.
4-11
Vista de pagina 106
1 2 ... 102 103 104 105 106 107 108 109 110 111 112 ... 323 324

Comentarios a estos manuales

Sin comentarios