Length PowerScript function
Description
Reports the length in bytes of an open OLE stream.
Controls
OLEStream objects
Syntax
|
1 |
<span>olestream</span>.<span>Length</span> ( <span>sizevar</span> <span></span>) |
|
Argument |
Description |
|---|---|
|
olestream |
The name of an OLE stream variable that |
|
sizevar |
A long variable in which Length will |
Return Values
Integer. Returns 0 if it succeeds and
one of the following negative values if an error occurs:
-
-1 Stream is
not open -
-9 Other error
If any argument’s value is null, Length 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 finds out the stream’s length and stores the
value in the variable info_len.
The example does not check the function’s 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 |
long info_len |
|
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>Length</span>(info_len) |