Rockwell-automation 1771-DB BASIC MODULE Manual de usuario Pagina 125

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 394
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 124
Chapter
Expressions, Variables and Operators
9
9 -15
The numbers printed in this example represent the ASCII characters A
through L.
>NEW
>1
REM EXAMPLE PROGRAM
>
5 STRING 1000,40
>
10 $(1)=“ABCDEFGHIKJL”
>
20 FOR X = 1 TO 12
>
30 PRINT ASC($(1),X),
>
40 NEXT X
>
50 END
READY
>RUN
65 66 67 68 69 70 71 72 73 75 74 76
READY
>
You can also use the ASC operator to change individual characters in a
defined string. In general, the ASC operator lets you manipulate individual
characters in a string.
>NEW
>1
REM EXAMPLE PROGRAM
>
5 STRING 1000,40
>
10 $(1) = “ABCDEFGHIJKL”
>
20 PRINT $(1)
>
30 ASC($(1),1) = 75 : REM DECIMAL EQUIVALENT OF K
>
40 PRINT $(1)
>
50 ASC($(1),2) = ASC($(1),3)
>
60 PRINT $(1)
READY
>RUN
ABCDEFGHIJKL
KBCDEFGHIJKL
KCCDEFGHIJKL
READY
>
Vista de pagina 124
1 2 ... 120 121 122 123 124 125 126 127 128 129 130 ... 393 394

Comentarios a estos manuales

Sin comentarios