Remote-processing BASIC 52 Instrukcja Użytkownika Strona 58

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 163
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 57
RPBASIC-52 PROGRAMMING GUIDE
2-39
EXAMPLE
The following example gets characters from the receive buffer and generates a checksum. A string of 10
characters is entered at com port 0.
10 STRING 200,20
20 PRINT "Type in 10 characters. Characters are not echoed"
30 IF COM(0) < 10 THEN 30
40 $(0) = com$(0)
50 CKSUM = 0
60 FOR N = 1 to STR(0,$(0))
70 CKSUM = CKSUM + ASC($(0),N)
80 NEXT
90 PRINT "Checksum of incoming string:",CKSUM
>run
Type in 10 characters. Characters are not echoed
(1234567890 are entered at the keyboard)
Checksum of incoming string: 525
Przeglądanie stron 57
1 2 ... 53 54 55 56 57 58 59 60 61 62 63 ... 162 163

Komentarze do niniejszej Instrukcji

Brak uwag