[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
    fbWrite()

         Writes to a binary file

    Syntax:

         fbWrite ( nHandle, cBuffer, nBuffer, nWrite, ;
                   cFile, lForce ) -> lexit

         nHandle : The file handle of the file.
         cBuffer : The buffer to write to the file.
         nBuffer : The number of bytes to be written.
         nWrite  : Variable that returns the number of bytes written.
         cFile   : The name of the file.
         lForce  : Logic value to force nBuffer to be the same value
                   as nWrite.

    Description:

         Writes nBuffer bytes from cBuffer to the file (nHandle).  cFile is
         used to allow error messages to be dislpayed. If lForce is .T. the
         value written to the file must be nBuffer bytes and doesn't return
         until nRead is equal to that amount. If lForce is .F. the function
         returns even though the value nRead hasn't been reached.  Forget
         retries becuase the same function checks all of that.

    Return:

         If there's an error returns .F. if not, returns .T.

    Example:

         cFile     := "Fast.txt"
         nHand     := fbOpen ( cfile, 2 )
         nWrite    := 100
         nBuffer   := 100
         cBuffer   := Space ( nBuffer )
         lForce    := .T.
         If ! fbWrite( nHand, cBuffer, nBuffer, @nWrite, cfile, lForce )
           Warning( "The read has been unsuccessful" )
         Else
           Warning( Str( nWrite ) + " must be the same " + Str( nBuffer ) )
         EndIf
         fbClose ( { nHand } )

See Also: fbOpen() fbClose() fbCreate() fbRead()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson