Sharp MZ-700 Series Owner's Manual page 59

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

Example
D E F
F N A ( X ) = 2 X X T 2 + 3 X X + 1
Defines 2X
2
+ 3X + 1 as FNA
(X).
D E F
F N E CV) = 1 / 2 X M X V T 2
Defines 1/2MV
2
as FNE (V).
1 0
D E F
F N B ( X ) = T A N ( X - P A I
( 1 ) 0 6 )
2 0
D E F
F N D ( X ) = F N B ( X ) / C + X--Defines function FNB using the
function defined on line 10.
(Incorrect definitions)
1 0
D E F
F N K ( X ) = S I N CX/3+PAIC1 )/4), F N L ( X ) = E X P ( - X T2/K)
. . . . Only one user function can be defined by a single DEF FN statement.
Find the kinetic energy of a mass of 5.5 when it is imparted with initial accelerations
of 3.5, 3.5 x 2, and 3.5 x 3.
1 0
D E F
F N E ( V ) = 1 Y 2 X M X V T 2
2 0
M = 5 . 5 : V = 3 .
5
3 0
P R I N T
F N E CV) , F N E C V X 2 ) , F N E
C V X 3 )
• 4 0
E N D
Note
All user function definitions are cleared when the CLR statement and the NEW
statement is executed.
2. 3. 7. 3 DEF KEY
Format
Function
DEF KEY (k) = S$
k
Definable function key number (1 to 10)
S$
Character string (up to 15 characters).
Character strings can be assigned to any of the ten function keys to allow strings
to be entered at any time just by pressing a single key. This statement is used to
define such strings and assign them to the definable function keys. Function key
numbers 1 to 5 are entered just by pressing the corresponding key at the top left
corner of the keyboard; keys 6 to 10 are entered by pressing the I SHIFT ~| key
together with the corresponding key. The function key number (1 to 10) is specified
in k, and the string or command which is to be assigned to the key is specified
exactly as it is to be entered in S$. Execution of the DEF KEY statement cancels
the previous definition of the definable function key.
No other statement can be specified after a DEF KEY statement on the same line.
(Example:)
1 0
D E F
K E Y ( 1 ) = " I N P U T "
Defines key [FT] as INPUT
2 0
D E F
K E Y ( 2 ) = " R U N " + C H R $ ( 1 3 ) - Defines RF2l as RUN J
Note: CHR$ (13) indicates the ASCII code foriCR|, and specifying it together with the string assigned to
a definable function key has the same effect as pressing the |CRj key. (See the description of the
CHR$ function on page 78 and the ASCII code table on page 154.)
57

Advertisement

Table of Contents
loading

Table of Contents