FILELIST Example


Example:

 

MyList

FILELIST

 

Prime

IFILE

NAME="Prime.isi"

Second

IFILE

NAME="Second.isi"

  

FILELISTEND

 

.

 

 

  

OPEN

MyList

  

WRITE

MyList;"TEST1 Record data"

  

CLOSE

MyList

 

This example opens a primary file (Prime.isi) and a secondary index file (Second.isi). It then writes a record to the primary file. The secondary file’s key is automatically inserted by the WRITE instruction. To perform the same functions without a FILELIST and Simplified File IO would require the following:

 

Prime

IFILE

 

PrimeKey

DIM

???

Second

IFILE

 

SecondKey

DIM

???

.

 

 

  

OPEN

Prime,"Prime.isi"

  

OPEN

Second,"Second.isi"

.

 

 

  

(construct PrimeKey)

  

(construct SecondKey)

.

 

 

  

WRITE

Prime,PrimeKey;"TEST1 Record data"

  

INSERT

Second,SecondKey

.

 

 

  

CLOSE

Prime

  

CLOSE

Second

 

 



PL/B Language Reference FILEIO Example FILEPI Examples