Syntax 2 For character arrays or blobs
Description
Reads data from an OLE stream object into a character array
or blob.
Controls
OLEStream objects
Syntax
|
1 |
<span>olestream</span>.<span>Read</span> ( <span>variable</span> {, <span>maximumread</span> } ) |
|
Argument |
Description |
|---|---|
|
olestream |
The name of an OLE stream variable that |
|
variable |
The name of a blob variable or character |
|
maximumread (optional) |
A long value specifying the maximum number |
Return Values
Integer. Returns 0 if it succeeds and
one of the following negative values if an error occurs:
-
-1 Stream is
not open -
-2 Read error
-
-9 Other error
If any argument’s value is null, Read returns null.
Examples
This example opens an OLE object in the file MYSTUFF.OLE and
assigns it to the OLEStorage object stg_stuff.
Then it opens the stream called info in stg_stuff and
assigns it to the stream object olestr_info.
Finally, it reads the contents of olestr_info into
the blob lb_info.
The example does not check the functions’ return
values for success, but you should be sure to check the return values
in your code:
|
1 |
boolean lb_memexists |
|
1 |
OLEStorage stg_stuff |
|
1 |
OLEStream olestr_info |
|
1 |
blob lb_info |
|
1 |
|
1 |
stg_stuff = CREATE OLEStorage |
|
1 |
stg_stuff.Open("c:ole2mystuff.ole") |
|
1 |
|
1 |
olestr_info.Open(stg_stuff, "info", & |
|
1 |
stgRead!, stgExclusive!) |
|
1 |
olestr_info.<span>Read</span>(lb_info) |