Tandy 1000 Basic Reference Manual page 133

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter
10 I
BASIC
Keywords
CVD, CVI, CVS
Function
C V D ( 8 - byte string)
CVI(2-byte string)
CVS(4-byte string)
Converts string values to numeric values.
These functions restore data to numeric form after it is read
from the disk. Typically, the data has been read by a GET state-
ment and is stored in a direct access file buffer.
CVD converts an 8-byte string to a double precision number.
CVS converts a 4-byte string to a single precision number.
CVI converts a 2-byte string to an integer.
CVD, CVI, and CVS are the inverse of MKD$, MKI$, and
MKS$, respectively.
Examples
A #
=
C V D < G R O S S P A Y $ )
assigns the numeric value of GROSSPAY$ to the double precision
variable A#.
Sample Program
This program reads from the file test.dat, which is created in the
sample program for the MKD$, MKI$, and MKS$ functions.
1 4 2 0 OPEN
"R",
1 , " t e ~ t . d a t " , 1 4
1 4 3 0
F I E L D
1 , 2
A S
I 1 $ ,
4
A S
I 2 $ , 8
A S
13s
1 4 4 0 G E T 1
1 4 5 0 P R I N T C V I < I l $ ) , CVS(I2$),
CVD(I39)
1 4 6 0
C L O S E
BASIC prints 3000, 3000.1 and 3000.00001.
Note: GET without a record number tells BASIC to
get the first record from the file or the record follow-
ing the last record accessed.
131

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents