Input keypad – Remote Processing CAMBASIC User Manual

Page 96

Advertising
background image

Comm ands - 63

INPUT KEYPAD$

Statement

SYNTAX:

INPU T KEYP AD$ echo port, variable
INPU T KEYP AD$ echo port, "text" , variable
INPU T KEYP AD$ echo port, "text" ; variable

PURPOSE:

To input data from a keypad. Optionally print text to echo port

REMARK S:

The IN PUT KEYP AD$ statement is sim ilar to the IN PUT statement in th at the prog ram pauses to
accept data from a matrix keypad.

The echo port parameter tells the system where to echo the keys pressed on the keypad. The display
must be previously initialized for an echo.

0

no echo

1

C O M 1

2

C O M 2

3-7

no echo

8

Graphics display (R PC-235 0 only, no e cho on others)

9

DP display

10

LCD display

11

speaker

12-255

no echo

The INPU T KEYP AD$ statement term inates when a carriage return (< CR> ) is received. One of
the keypad keys must be configured to return a < CR> (13 or&D) w hen pressed using the SYS(8)
command. By default, key position 15 returns a < CR> . A < CR> < LF> sequence is sent to the
echo port when a < CR> is sent. On all echo ports, exce pt the LCD display, the line advanc es.
The cur sor retur ns back to the beginning of the line on LC D' s.

"text" is optionally printed to the echo port. This is useful as part of a prompt. The character
following the last quotation (") determines if a question mark (?) is printed or not. A com ma (, )
suppresses printing a ? while a semi-colon (;) will print one.

This command m ust be initialized by ON KEY PAD $. W hen INPU T KEYP AD$ is executed, the
subroutine specified in ON KEYPA D$ is not executed. Even if you use INP UT KE YPAD $ as your
o n ly k ey p ad in p ut , y ou m u st ha v e a v al id li ne n um b e r s p ec i fi e d a s pa r t o f th e O N K E Y P A D $
routine.

variable is a string (for example, N AME $) or numeric (for exam ple, WE IGHT). As with the
regular INP UT statement, any string characters entered into a numeric variable prom pts for a redo.
LCD displays do not pr ompt for a redo, but the cur sor re turns bac k to the point wh ere it is
requesting data.

RELATED:

KEYPA D$, ON KEY PAD $

Advertising