Rockwell-automation 2708-NBD VBASIC Language Development Kit Manual de usuario Pagina 24

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 84
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 23
Chapter 4
Special Devices in A-B VBASIC
43
Note: See the description of PRINT USING and WRITE for details on other
formatting options supported.
See also the READ.BAS collection of BASIC Language Development Kit
subroutines for useful LCD output subroutines, including automatic
formatting of display lines, automatic clearing of the display, and cursor
positioning.
CLS
Name$ = “Fred”
PRINT “Please Enter Now!”
PRINT “Thank You”; Name$; ‘ Keep cursor on second line.
CONST ScreenDev = 1
OPEN “LCD” FOR OUTPUT AS #ScreenDev ‘ Cannot be CLOSEd
LineWidth% = LOF (ScreenDev) \ 2 ‘ Width of display.
PRINT #ScreenDev, “Please Enter Code:”; ‘ Cursor remains on line.
LINE INPUT, Code$
Reserved device name: KEYS
These statements always access the Keypad:
INPUT$ (without a file number)
LINE INPUT (without a file number)
INKEY$
When a Keypad line is being entered with LINE INPUT, only the enter and
backspace keys perform the expected termination and correction functions.
As an alternative, INPUT$ and LINE INPUT can be used to access this
device using OPEN KEYS.
The BASIC Language Development Kit (Catalog No. 2708-NBD) modules
READ.BAS and MENU.BAS contain several helpful subroutines for
obtaining input through the Keypad.
CONST KeyDev = 1 ‘ Assign device a file number
OPEN “KEYS” FOR INPUT AS #KeyDev ‘ Open device.
DO WHILE a$ = ” ”: a$ = INKEY$: LOOP ‘ Wait for a key stroke.
LINE INPUT “Enter your name: ”; Name$ ‘ Must press enter.
b$ – INPUT$ (1) ‘ Another way to get a key stroke.
Device: LCD Display
(contd)
Device: Keypad
Vista de pagina 23
1 2 ... 19 20 21 22 23 24 25 26 27 28 29 ... 83 84

Comentarios a estos manuales

Sin comentarios