Sharp OZ-707 Operation Manual - Page 99

On Key Gosub

Page 99 highlights

ON KEY GOSUB p FORMAT: ON KEY GOSUB {line number 1} {line number 2} *Iabel 1 ' *label2 ,... , line number 20} {*label20 4bbrev;ation: O. KE. GOS. See Also: KEY (n) ON/OFF, ON...GOSUB, GOSUB...RETURN PURPOSE: )efines the interrupt service line for a transparent guide key. qEMARK5: )N KEY GOSUB command passes execution to the line with the line lumber given by this command when a transparent guide key with the .ey number given in the KEY (key number) ON command is pressed. .ine number 1 gives the first line of the interrupt service routine to vhich execution is passed when transparent guide key 1 is pressed; ine number 2 gives the line to which execution is passed when ransparent guide key 2 is pressed, and so on. Jse commas to separate line numbers. No line numbers need be ;pecified for keys which are not ON, but the comma separator is lecessary. If guide key n is the highest guide key used, n-1 commas lre required. Line numbers may also be specified with *Iabels. An !rror occurs if a specified line was not found. lince interrupt service is executed in a subroutine, the last line of Ivery routine must be a RETURN statement. :XAMPLE: 10: CLS: A=O:WAIT 20: KEY (2)ON :KEY (4)ON 30: KEY (10)ON :KEY (16)ON 40: ON KEY GOSUB ,80"90"""100,,,,..110 50: A=A+1 60: WAIT :LOCATE 2,0:PRINT A 70: GOTO 50 80: WAIT 10:LOCATE O,2:PRINT "key 2":RETURN 90: WAIT 10:LOCATE 0,2:PRINT "key 4":RETURN 00: WAIT 10:LOCATE 0,2:PRINT "key10":RETURN 10: WAIT 10:LOCATE 0,2:PRINT "key16":RETURN 186 OPEN P D FORMAT: 1. OPEN "d:filename" FOR mode AS # file number d: E, PACOM, CAS 2. OPEN "baud rate, parity, word length, stop bit, type of code, delimiter, end-of-file code, XON, shift code" AS # file number 3. OPEN Abbreviation: OP. See Also: CLOSE, OPEN$ PURPOSE: Opens a file or the serial 1/0 interface for data transfer. REMARKS: Format 1 opens the file specified by "d:filename" for use with the specified file number. Subsequent input/output to the file is accomplished by referring to the file number. Formats 2 and 3 allow data to be transferred through the serial 1/0 interface (COM). The file number must be from 1 to 255. A maximum of two files on any devices may be opened at the same time. Only the following device combinations are possible: E E 0 PACOM 0 CAS 0 COM*' 0 PACOM 0 x x 0 CAS 0 x x 0 COM* 0 0 0 x 0 : may be opened at the same time. x : may not be opened at the same time. • To open files on the device COM and another device at the same time. open the file on the device COM first. Note: When executing the SAVE, LOAD, CHAIN, or MERGE statement, the Card opens one file automatically. In format 1, "mode" specifies the method of access to the file, as follows: INPUT Specifies sequential input from an existing file. OUTPUT Specifies sequential output to a device or file. APPEND Specifies addition to a sequential file. 187

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128

ON KEY GOSUB
FORMAT:
ON KEY GOSUB
{line
number
1}
{line
number
2}
*Iabel
1
'
*label2
,
...
,
4bbrev;ation:
O. KE. GOS.
{
line number
20}
*label20
See
Also:
KEY
(n)
ON/OFF, ON
...
GOSUB, GOSUB ... RETURN
PURPOSE:
)efines the interrupt service line for a transparent guide key.
qEMARK5:
)N
KEY GOSUB command passes execution to the line with the line
lumber given by this command when a transparent guide key with the
.ey number given
in
the KEY (key number) ON command is pressed.
.ine number 1 gives the first line of the interrupt service routine to
vhich execution
is
passed when transparent guide key 1 is pressed;
ine number 2 gives the line to which execution is passed when
ransparent guide key 2 is pressed, and so on.
Jse
commas to separate line numbers. No line numbers need be
;pecified
for
keys which are not ON, but the comma separator is
lecessary. If guide key n is the highest guide key used,
n-1
commas
lre required. Line numbers may also be specified with *Iabels. An
!rror occurs if a specified line was not found.
lince interrupt service is executed
in
a subroutine, the last line of
Ivery routine must be a RETURN statement.
:XAMPLE:
10:
CLS:
A=O:WAIT
20:
KEY
(2)ON
:KEY
(4)ON
30:
KEY
(10)ON
:KEY
(16)ON
40:
ON
KEY
GOSUB
,80"90"""100,,,,
..
110
50:
A=A+1
60:
WAIT
:
LOCATE
2,0:PRINT
A
70:
GOTO
50
80:
WAIT
10:LOCATE
O,2:PRINT
"key
2":RETURN
90:
WAIT
10:LOCATE
0,2:PRINT
"key
4":RETURN
00:
WAIT
10:LOCATE
0,2:PRINT
"key10":RETURN
10:
WAIT
10:LOCATE
0,2:PRINT
"key16":RETURN
186
p
r'
OPEN
FORMAT:
1. OPEN "d:filename" FOR mode AS
#
file number
d:
E,
PACOM, CAS
P
D
2.
OPEN "baud rate, parity, word length, stop bit, type of
code, delimiter, end-of-file code, XON, shift code"
AS
#
file number
3.
OPEN
Abbreviation:
OP.
See
Also:
CLOSE, OPEN$
PURPOSE:
Opens a file
or
the serial
1/0
interface for data transfer.
REMARKS:
Format 1 opens the file specified
by
"d:filename" for use with the
specified file number. Subsequent input/output to the file is
accomplished
by
referring to the file number.
Formats 2 and
3
allow data to be transferred through the serial
1/0
interface (COM).
The file number must be from 1 to
255.
A maximum
of
two files on any devices may be opened at the same
time. Only the following device combinations are possible:
E
PACOM
E
0
0
PACOM
0
x
CAS
0
x
COM*'
0
0
Note:
CAS
COM*
0
0
x
0
x
0
0
x
0 :
may be opened at the same time.
x : may not
be
opened
at
the same time.
• To open files on the device COM and
another device at the same time. open
the file
on
the
device
COM first.
When executing the SAVE, LOAD, CHAIN, or MERGE statement, the
Card opens one file automatically.
In format
1,
"mode" specifies the method of access to the file, as
follows:
INPUT
OUTPUT
APPEND
Specifies sequential input from an existing file.
Specifies sequential output to a device
or
file.
Specifies addition to a sequential file.
187