MemberDelete PowerScript function
Description
Deletes a member from an OLE object in a storage. The member
can be another OLE object (a substorage) or a stream.
Controls
OLEStorage objects
Syntax
|
1 |
<span>olestorage</span>.<span>MemberDelete</span> ( <span>membername</span> ) |
|
Argument |
Description |
|---|---|
|
olestorage |
The name of an object variable of type |
|
membername |
A string specifying the name of the member |
Return Values
Integer. Returns 0 if it succeeds and
one of the following negative values if an error occurs:
-
-1 The storage is not
open -
-2 Member not found
-
-3 Insufficient resources or too many files
open -
-4 Access denied
-
-5 Invalid storage state
-
-9 Other error
If any argument’s value is null, MemberDelete returns null.
Examples
This example creates a storage object and opens an
OLE object in a file. It checks whether wordobj is
a substorage within that object and, if so, deletes it and saves
the object back to the file:
|
1 |
boolean lb_memexists |
|
1 |
integer result |
|
1 |
|
1 |
stg_stuff = CREATE OLEStorage |
|
1 |
stg_stuff.Open("c:ole2mystuff.ole") |
|
1 |
|
1 |
stg_stuff.MemberExists("wordobj", lb_memexists) |
|
1 |
IF lb_memexists THEN |
|
1 |
result = stg_stuff.<span>MemberDelete</span>("wordobj") |
|
1 |
IF result = 0 THEN stg_stuff.Save() |
|
1 |
END IF |