參數(shù)資料
型號: NSB8
廠商: Electronic Theatre Controls, Inc.
英文描述: BASIC interpreter for Z80 family
中文描述: Z80的BASIC解釋為家庭
文件頁數(shù): 113/158頁
文件大?。?/td> 752K
代理商: NSB8
ITALIAN TECHNOLOGY
grifo
Page 101
NSB8 Rel. 5.10
RANDOM DATA ACCESS
BASIC keeps track of where it is supposed to read and write next in an open file by maintaining a
file pointer for it. This pointer specifies the number of bytes from the start of the file to the current
read/write position. This number is called a random file access. When a file is opened, its file pointer
is set to 0, meaning that the first data access will happen at the start of the file. You can change the
value of the pointer, and so access file fata beginning at any point in a file. This is called random
access and is one of the quickest means of storing and retrieving data in files because it is not
necessary to read all the data items in a file in order to get to the one you want. By changing the file
pointer to reference the location of the data item you seek, you can read or write it immediately.
A random address expression is added to a READ# or WRITE# statement in order to access data
randomly. The random address expression is a numeric expression following a percent sign (for
example: %R*5). The expression must evaluate to an integer from 0 to the file length value in bytes.
If an address expression is ever negative or greater than the limit given by the above formula, a
program error will occur.
In order to use random access, you must be able to determine the necessary random address of the
particular piece of data you want. The easiest way to do this is to require that all items in the file be
of the same type or size. For example, a file intended for random access might consist of all numbers,
or all 10 character strings. Alternately, a random access file might contain 100 records of 62 bytes
each. Each record might consist of 4 numbers in a row, plus a string of length 40.
How was the figure of 62 bytes for the record size computed In order to find out how much disk
storage space a group of items will require, you must add up all the actual sizes of each of the
elements. Refer to section IMPLEMENTATION NOTES, for information on computing the storage
sizes for strings and numbers.
Knowing exactly how long each element or record is, you can treat the entire file as a huge array of
items or records, computing the random address of the X
th
item in the file with the following
expression:
(X-1)*R
where R is the size of an individual record or item, given in bytes. Add a percent sign in front of this
expression, and you have a legal random address expression! To illustrate, given a file of strings, the
storage length of each being 42 bytes, then the first string would occur at address 0, which is
(1-1) * 42 = 0. The 50
th
string occurs at random address (50-1) * 42 = 49 * 42 = 2058.
Random access records may easily be updated in place, although you must still use NOENDMARK
to avoid the writing of an endmark after rewriting the record (the extra endmark could contaminate
the data in the next record!).
Here is a program which accesses any element of a random access file of 1000 strings, each of which
is 250 characters long:
10 REM Random string access.
20 OPEN #1,”RANDSTR”
30 DIM R$(250)
40 R=250+2
50 REM R is size of one item: see IMPLEMENTATION NOTES for details.
60 INPUT “WHICH STRING (1-1000, 0 TO QUIT) “,I
70 IF I=0 THEN 130
80 IF I<1 OR I>1000 THEN 60
85 REM Check for out of range item number.
相關(guān)PDF資料
PDF描述
NSB9435T1 High Current Bias Resistor Transistors(高強度電流偏置電阻晶體管)
NSBA114EDXV6T1 Dual Bias Resistor Transistors(雙偏置電阻晶體管)
NSBA114YDXV6T1 Dual Bias Resistor Transistors(雙偏置電阻晶體管)
NSBC143TPDXV6T1 Dual Bias Resistor Transistors(雙偏置電阻晶體管)
NSBC144EPDXV6T1 Dual Bias Resistor Transistors(雙偏置電阻晶體管)
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
NSB8AT 制造商:VISHAY 制造商全稱:Vishay Siliconix 功能描述:Glass Passivated General Purpose Plastic Rectifier
NSB8AT/31 功能描述:整流器 50 Volt 8.0 Amp 125 Amp IFSM RoHS:否 制造商:Vishay Semiconductors 產(chǎn)品:Standard Recovery Rectifiers 配置: 反向電壓:100 V 正向電壓下降: 恢復(fù)時間:1.2 us 正向連續(xù)電流:2 A 最大浪涌電流:35 A 反向電流 IR:5 uA 安裝風(fēng)格:SMD/SMT 封裝 / 箱體:DO-221AC 封裝:Reel
NSB8AT/45 功能描述:整流器 50 Volt 8.0 Amp 125 Amp IFSM RoHS:否 制造商:Vishay Semiconductors 產(chǎn)品:Standard Recovery Rectifiers 配置: 反向電壓:100 V 正向電壓下降: 恢復(fù)時間:1.2 us 正向連續(xù)電流:2 A 最大浪涌電流:35 A 反向電流 IR:5 uA 安裝風(fēng)格:SMD/SMT 封裝 / 箱體:DO-221AC 封裝:Reel
NSB8AT/81 功能描述:二極管 - 通用,功率,開關(guān) 50 Volt 8.0 Amp 125 Amp IFSM RoHS:否 制造商:STMicroelectronics 產(chǎn)品:Switching Diodes 峰值反向電壓:600 V 正向連續(xù)電流:200 A 最大浪涌電流:800 A 配置: 恢復(fù)時間:2000 ns 正向電壓下降:1.25 V 最大反向漏泄電流:300 uA 最大功率耗散: 工作溫度范圍: 安裝風(fēng)格:SMD/SMT 封裝 / 箱體:ISOTOP 封裝:Tube
NSB8AT-E3/31 功能描述:整流器 50 Volt 8.0 Amp 125 Amp IFSM RoHS:否 制造商:Vishay Semiconductors 產(chǎn)品:Standard Recovery Rectifiers 配置: 反向電壓:100 V 正向電壓下降: 恢復(fù)時間:1.2 us 正向連續(xù)電流:2 A 最大浪涌電流:35 A 反向電流 IR:5 uA 安裝風(fēng)格:SMD/SMT 封裝 / 箱體:DO-221AC 封裝:Reel