#5
SAMPLE PROGRAM - Eltrmsmp.tsk (Cont.)
GOSUB Menu_Display
DO
Keypress=INCHAR(2)
' Continuously loops until a key is
LOOP WHILE Keypress=0
' pressed on the ELTERM 24
IF Keypress=65 THEN GOSUB Get_Distance
' F1 Key
IF Keypress=66 THEN GOSUB Get_Speed
' F2 Key
IF Keypress=67 THEN GOSUB Get_Repeat
' F3 Key
IF Keypress=68 THEN GOSUB Execute
' F4 Key
IF Keypress=69 THEN GOSUB JOG_Forward
' Up Arrow
IF Keypress=70 THEN GOSUB JOG_Reverse
' Down Arrow
GOTO Begin
Menu_Display:
DISP 1,1,"F1-Dist. F3-Repeat"
' The DISP command prints
DISP 2,1,"F2-Speed F4-Exec."
' the items in quotes on the
DISP 3,1,"Up Arrow -Jog(+)"
' screen of the ELTERM 24.
DISP 4,1,"Dwn Arrow-Jog(-)"
RETURN
Get_Distance:
CLRSCRN
' Clear Screen.
DISP 1,3,"Move Distance"
' Print the followings messages
DISP 2,1,"in inches="
' to the screen.
DISP 4,1,"ESC-Exit ENTER-Edit"
fmt$="####.0"
' Define the length and layout
' of the parameter.
min=-9999.9
' Define min value.
max=9999.9
' Define max value.
Value=Distance
row=2
' Define the location to
col=11
' print the parameter.
LOCATE row,col
' Position cursor.
PRINT USING#2,fmt$,Value ' Prints initial number to
' the screen.
DO
' Wait for a keypress.
Keypress=INCHAR(2)
LOOP WHILE Keypress=0
IF Keypress=13 THEN ' Go edit value if key press
CLRLINE 3
' is the ENTER key.
CLRLINE 4
DISP 4,5,"Edit Value"
GOSUB GetValue
END IF
StockCheck.com