738
then insert the new one. The functions IND( ), p.455, KEF( ), p.464, KEL( ), p.465,
KEN( ), p.466, KEP( ), p.467, KEY( ), p.468, and RNO( ), p.512 can be used with
memory-queue files.
Format 2: Create Memory-Resident Multi-Key File
OPEN (chan[,fileopt])"*MEMORY* [;KEYDEF=key_def$ ]"
Use this format to create a memory-resident multi-key file similar to regular Keyed
files. I/O directives and functions supported by Keyed files are also supported by
this type of memory file. Due to the way this format is processed, performance is
generally better than using Format #1 with key access.
Files are limited to 2GB in size. The current size, or amount of memory being used
can be determined by querying NUM(FIN(chan,"FILELENGTH")) or
DEC($00$+MID(FIN(chan),1,4)). Extended records are supported by
indicating a record size in excess of 31,000 byte; e.g., BSZ=32000 (the BSZ= value, if
specified, must be a positive value).
Note: The ability to access a memory file in a mixed mode (by KEY= and/or IND=) is
not supported.
See Also
Examples
The following example illustrates how to open and use *MEMORY* using Format 1:
00010
mmf=hfn
00020
open (mmf)"*memory*"
00030
print 'CS'
00040
input "Name (Press F4 to end):",name$
00050
if ctl=4 then goto 0100
00060
input "Address:",addr$
00070
input "Position:",pos$
00080
write (mmf,key=name$)iol=mmfLst
00090
goto 0030
00100
print 'CS'
00110
select iol=mmfLst from mmf begin "" end "z"
00120
print "Name:",name$
00130
print "Address:",addr$
00140
print "Position:",pos$
00150
print "----------"
00160
next record
00170
end
00180
mmfLst: iolist name$,addr$,pos$