Random Access File Control - Sharp MZ-700 Basic Manual

Disk basic interpreter
Hide thumbs Also See for MZ-700:
Table of Contents

Advertisement

23
i
1.5 Random Access File Control
Random access files are data files in which the registration or read-out of data is in the
random access format. The randoll\ access format is the format in which the access is
done by specifying the array format.
In other words, compared to the sequential access format in which access must be
from the heading of the data, the random access format can be used for access to any
data in the file at random.
In order to access data in the random access file in a specified array, PRINT # (page
49) and INPUT # (page 47) are used, as described below, as expressions following
logical numbers.
PRINT #n (expression), data
INPUT #n (expression), variable
Designation of tay element
The expression is assigned by numbers or variables.
For example, the statement
INPUT
#7
(21),
A$
means a command to read-out, to string variable AS, the data registered as the 21st
element of the data collected as the random access file opened by logical number #7.
Note that random access files in which data such as this can be accessed have the
condition that all data must be
register~d
at a fixed length, Le., when numbers or
string variables are registered in the file, they must each be set within a "box" with a
limited length of 32 bytes.
expression
~
32-byte fixed length
{
~
+. 12345678+ElO
Random access
3
file
4
ABCDEFGHI
-
5
I-Ac::B-=C _ _ _ _ _ --t
6
:
+-
Variable A=O. 12345678+ElO
+-
String "ABCDEFGHI"
:.- String "ABC"
For numerical variables, even exponential expressions are always stored within the
32-byte length, but, because string variables can be as long as 249 bytes, a string which
exceeds 32 bytes cannot be registered in one data element of a random access file.
One other point which is different from sequential access files is that even though a file

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mz-2z009

Table of Contents