Skip to main content
Skip table of contents

f$FileWriteValue (f$DateiSchreibeWert)


f$FileWriteValue (f$DateiSchreibeWert)

Insert a binary value in the file previously opened for writing. This function is only useful if the file was opened in binary format (letter b).

Syntax:

Status = f$FileWriteValue ( FileNo , Value [,Bytes] )

 

Argument

Type

Meaning

 

FileNo

Integer

File number

 

Value

Integer

Value to be written into the file

 

Bytes

Integer

Number of bytes to be written into the file. This parameter is optional. If the parameter is not given, one byte is written into the file.

Result:

Integer

0: successfully written

< 0 indicates an error

Example:

File name = 'c:\\temp\\test.dat'

f$FileRemove( Filename )

FileNo = f$FileOpen( Filename, 'wb' )

Status = f$FileWriteValue (FileNo, 1 )

Status = f$FileWriteValue (FileNo, 100 )

Status = f$FileWriteValue (FileNo, 1000 ,2 )

Status = f$FileWriteValue (FileNo, 10000 ,4 )

Status = f$FileWriteHex (FileNo, 'F000FF000D0A' )

Status = f$CloseFile( FileNo )

File content in hexadecimal form:

01 64 e8 03 10 27 00 00 f0 00 ff 00 0d 0a

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.