Rockwell-automation 1771-DB BASIC MODULE Manuel d'utilisateur Page 169

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 394
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 168
Chapter
Statements
1
1
11 -17
Use the INPUT statement to enter data from the console device during
program execution. You may assign data to one or more variables with a
single input statement. You must separate the variables with commas.
You are prompted to enter data for each variable after the INPUT. If you
do not enter enough data, the module prints
TRY
AGAIN
on the console
device.
>10
INPUT A,C
You can write the INPUT statement so that a descriptive prompt tells you
what to enter. The message printed is placed in quotes after the INPUT
statement. If a comma appears before the first variable on the input list,
the question mark prompt character is not displayed.
>10
INPUT “ENTER A NUMBER – ”,A
You can also assign strings with an INPUT statement. Strings are always
terminated with a carriage return (cr). If more than one string input is
requested with a single INPUT statement, the module prompts you with a
question mark. You can assign strings and variables with a single INPUT
statement.
>20
INPUT “NAME(CR),AGE – ”,$(1),A
Use the INPUT# statement to input data from port PRT2. Use the
INPUT@ statement to input data from port PRT1. Both these statements
function like the INPUT statement.
Syntax
INPUT
Example
>1
REM EXAMPLE PROGRAM
>
10 INPUT A,C
>
20 PRINT A,C
>RUN
?1
TRY AGAIN
?1,2
l 2
INPUT
Vue de la page 168
1 2 ... 164 165 166 167 168 169 170 171 172 173 174 ... 393 394

Commentaires sur ces manuels

Pas de commentaire