[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FLUSH                    Write File Buffers to Disk                  pp 96

 Syntax:  Flush (FileVar) ;

 Type:    File

 Form:    Procedure

 Purpose: Empty the internal sector bufffer associated with FileVar.

 Notes:   This assures that the sector buffer is written to disk if any
          write operations have taken place since the last physical write
          to disk.  This also insures that the next read operation will
          perform a physical read of the disk.
          Flush does not apply to text files.

 ----------------------------------------------------------------------------



 Usage:
       CONST
          FileName : String [8] = 'Name.Ext'   ; { Constant file name }
       TYPE
          CheckNumber = 1..10000               ; { Check number type }
          CheckDate   = String [9]             ; { DDMMMYYYY             }
          PayeeType   = String [80]            ; { Payee type            }
          Check       = Record
                        CheckNum : CheckNumber ; { Check number field    }
                        Amount   : Real        ; { Amount field          }
                        Date     : CheckDate   ; { Date field            }
                        Payee    : PayeeType   ; { Payee field           }
                        End                    ; { End of record         }
       VAR
          FileVar     : File of Check          ; { 80 byte record type   }
          ThisCheck   : Check                  ; { Individual check type }

       BEGIN
          Assign (FileVar,FileName)            ; { Assign name to handle }
          Reset  (FileVar)                     ; { Open file handle      }
          Write  (FileVar, ThisCheck)          ; { Write a record        }
          Flush  (FileVar)                     ; { Force a disk write    }
          Close  (FileVar)                     ; { Close the handle      }
       END.

See Also: Read ReadLn Write WriteLn
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson