beautypg.com

Inpl, Inpl -39, Syntax – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 229: Example, Purpose

background image

Publication 1746-RM001A-US-P

Input Functions 13-39

Syntax

GET

Example

>1

REM EXAMPLE PROGRAM

>10 A = GET

>20 IF (A<>0) THEN PRINT A : REM ZERO MEANS NO ENTRY

>30 GOTO 10

>RUN

65 [A]

49 [1]

24 [^X]

50 [2]

STOP - IN LINE 30

READY

>

The GET operator is read only once before it is assigned a value of zero. This
guarantees that the first character entered is always read, independent of where the
GET operator is placed in the program. There is no buffering of characters on the
program port.

INPL

Purpose

Use the INPL statement to read an entire line (up to 254 characters) from program
port buffer. The line must be stored in a string variable. The INPL statement reads
all characters from the program port until a carriage return or the 254 character
limit is reached, whichever comes first. INPL does not echo characters read from
the program port.

Use the INPL# statement to read an entire line of characters from the PRT2 port
buffer. Use the INPL@ statement to read an entire line of characters from the
PRT1 port buffer. Both these statements function like the INPL statement.

Syntax

INPL string_variable