Writes data to an OLE stream object or a file that you open with the FileDirect object.
To |
Use |
---|---|
Write data to an OLE stream object |
|
Write data into an array |
|
Write data into a blob |
Writes data to an opened OLE stream object.
OLEStream objects
olestream.Write ( dataforstream )
Integer. Returns the number of characters or bytes written if it succeeds and A negative integer if an error occurs.
Writes data from an array into an open file.
FileDirect objects
Integer instancename.Write ( data[ ], bytecount)
Argument |
Description |
---|---|
instancename |
Name of the instance of the FileDirect object |
data[ ] |
An array of integers representing bytes of data |
bytecount |
Integer for the number of bytes that you want to write in the open file |
Integer. Returns 1 for success and a negative number for any error.
Use this function to write to a file that you open with the FileDirect object in write mode. The FileDirect object supports only the synchronous style of file input; further file-related commands cannot be called until after the Write function is fully processed or an error in writing to the file is caught.
The following example calls the FileDirect user object nvo_fileDirect to open a file, write some data, and close the file:
Integer li_ret, li_AmountRead, li_data [ ] li_ret = nvo_fileDirect.Open ("COM8:", stgReadWrite!) li_ret = nvo_fileDirect.Write (li_data[], 100) li_ret = nvo_fileDirect.Close ( )
Writes data from a blob to an open file.
FileDirect objects
Integer instancename.Write ( bdata, bytecount)
Argument |
Description |
---|---|
instancename |
Name of the instance of the FileDirect object |
bdata |
A blob variable holding the data that you write to a file |
bytescount |
Integer for the number of bytes that you want to write to the open file |
Integer. Returns 1 for success and a negative number for any error.
Use this function to write to a file that you open with the FileDirect object in write mode. The FileDirect object supports only the synchronous style of file input; further file-related commands cannot be called until after the Write function is successfully processed or until an error in writing to the file is caught.
The following example calls the FileDirect user object nvo_fileDirect to open a file, write some data, and close the file:
Integer li_ret, li_AmountRead Blob lb_data li_ret = nvo_fileDirect.Open ("MyDoc.txt", stgRead!) li_ret = nvo_fileDirect.Write (lb_data, 100) li_ret = nvo_fileDirect.Close ( )