Rockwell-automation 1746-BAS BASIC LANGUAGE User Manual Page 232

  • Download
  • Add to my manuals
  • Print
  • Page
    / 280
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 231
Publication 1746-RM001A-US-P
13-42 Input Functions
ENTER A NUMBER - 25
5
READY
>
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.
>1 REM EXAMPLE PROGRAM
>10 STRING 100,20
>20 INPUT “NAME(CR),AGE - ”,$(1),A
>30 PRINT “HELLO ”,$(1), “YOU ARE ”,A,“ YEARS OLD.”
>40 END
READY
>RUN
NAME(CR),AGE - PAM
?29
HELLO PAM YOU ARE 29 YEARS OLD.
READY
>
You can assign strings and variables with a single INPUT statement.
>1 REM EXAMPLE PROGRAM
>10 STRING 100,10
>20 INPUT “NAME(CR), AGE - ”,$(1),A
>30 PRINT “HELLO ”,$(1),“, YOU ARE ”, A,“ YEARS OLD”
>40 END
>RUN
NAME(CR),AGE - FRED
?15
HELLO FRED, YOU ARE 15 YEARS OLD
READY
>
Page view 231
1 2 ... 227 228 229 230 231 232 233 234 235 236 237 ... 279 280

Comments to this Manuals

No comments