| Directives |
|
| Format | EXTRACT
RECORD (chan[,fileopt])var$
|
|||||||||||||||||||||||||||||||||
| Description | Use
the EXTRACT RECORD directive to read a
record from the file you specify (channel). ProvideX will return the record's
complete data portion in the string variable you specify.
Apply the EXTRACT RECORD statement when dealing with native-mode operating system files, when exchanging data with non-ProvideX applications, or when you want to read a complete record (including data field separators). The EXTRACT RECORD directive advances the file position to the next record (or the record specified in a KEY= or IND= option). Use the KNO= option to change the current file access key. |
|||||||||||||||||||||||||||||||||
| *Note* | This directive locks the record being read to prevent other users from using a FIND, FIND RECORD, READ, READ RECORD, EXTRACT RECORD or another EXTRACT RECORD to access it. This lock remains active until the next I/O request for the same file or until the file is closed. Using a KEY= option or READ, FIND or EXTRACT statement to retrieve the next record while a record is locked will result in the locked record being returned instead.You can enable readaccess for records that have been extracted by setting the 'XI' parameter. | |||||||||||||||||||||||||||||||||
| See Also | FIND
Locate and Read Data, READ Read Data from File, KEY( ) Function. |
|||||||||||||||||||||||||||||||||
| Examples | 0010
OPEN (1) "OLDFIL" 0020 OPEN (2) "NEWFIL" 0030 LOCK (2) 0040 EXTRACT RECORD (1,END=1000) R$ 0050 WRITE RECORD (2) R$ 0060 GOTO 0040 1000 CLOSE 1010 END |
|||||||||||||||||||||||||||||||||