Remote-processing BASIC 52 Manual do Utilizador Página 58

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 163
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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
Vista de página 57
1 2 ... 53 54 55 56 57 58 59 60 61 62 63 ... 162 163

Comentários a estes Manuais

Sem comentários