Remote-processing CAMBASIC Instrukcja Użytkownika Strona 36

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 208
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 35
Commands - 3
AND
Numeric Fun ction
SYNTAX: n = a AND b
PURPOSE: Performs bitwise or logical operation on two numbers. AND'ing is usually performed during I/O
operations to set a line low.
REMARK S: Variables a and b are in the range of 0 to 65,535 (&FF FF). When printed, numbers greater than
32,768 are negative.
Logical A ND' ing is performed during IF -THEN operations to test if all conditions ar e met.
RELATED: OR, XOR
EXAMPLE: 10 A = INP(0) :'get current status of port
20 A = A AND &FE :'set bit number 1 low
30 OUT 0,A :'output new status
40 PRINT A
RUN
8
Use AND in an IF-THEN statement to make sure all conditions are true.
10 IF (TEMPERATURE > 100) AND (HUMIDITY < 5) THEN GOTO ..dry
When the variable TEM PERATURE is more than 3 and variable HUM IDITY < 25 then the
condition is true. In this case, AND returns a true (non-zero) condition.
ERROR: none
Przeglądanie stron 35
1 2 ... 31 32 33 34 35 36 37 38 39 40 41 ... 207 208

Komentarze do niniejszej Instrukcji

Brak uwag