Chapter
10
I
BASIC Ke.ywords
MKD$, MKI$, MKS$
Function
MKD$(double precision expression)
MKI$( integer expression)
MKS$(single precision expression)
Converts numeric values
to
string values.
Any numeric value that is placed in a direct file buffer with an
LSET
or
RSET statement must be converted to
a
string.
These
3
functions are the inverse
of
CVD, CVI, and CVS. The
byte values that make up the number are not changed; only
1
byte, the internal data-type specifier, is changed
so
that numeric
data can be placed in
a
string variable.
MKD$ returns an 8-byte string; MKI$ returns a 2-byte string;
and MKS$ returns a 4-byte string.
Example
LSET
AVGS.
=
MKSS(0.123)
Sample Program
1350
OPEN
"R",
1
I
"te~t.dat",
14
1360
FIELD
1,
2
AS
119, 4
AS
I2$,
8
AS
13s
1370
LSET
IIS
=
MKIS(3000)
1380
LSET
12s
=
MKSSC3000.1)
1390
LSET
13s
=
MKDSC3000.00001)
1400
PUT
1, 1
1410
CLOSE
1
For a program that retrieves the data from
test.dat,
see CVDi
CVI/CVS.
221