Remote-processing CAMBASIC Instrukcja Użytkownika Strona 43

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 208
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 42
Commands - 10
BIN$
String Function
SYNTAX: n$ = BIN$(m)
PURPOSE: Returns an 8 bit binary representation of a number.
REMARK S: The most significant bit (bit 7) is on the left and the least significant is on the right. If a string
argument is inadvertently used, the result will be zero.
This function is primarily used with the INP function to display the status of each input line.
RELATED: The HEX$ function and the “@” binary prefix.
EXAMPLE: PRINT BIN$(199)
11000111
This example illustrates the usefulness of BIN$ to determine the status of an I/O port. Suppose that
the port is connected to switches. Reading the value with the INP function yields 199. Without
doing calculations, it is difficult to tell which sw itches are on. Using BIN $ you can see immediately
that switches 0, 1, 2, 6 and 7 are on.
ERROR: < Type mismatch> if m is a string or n is not a string.
< Data > 255> for m.
< Data negative > for m.
Przeglądanie stron 42
1 2 ... 38 39 40 41 42 43 44 45 46 47 48 ... 207 208

Komentarze do niniejszej Instrukcji

Brak uwag