InsertFile PowerScript function
Description
Inserts an object into an OLE control. A copy of the specified
file is embedded in the OLE object.
Syntax
|
1 |
<span>olecontrol</span>.<span>InsertFile</span> ( <span>filename</span> ) |
|
Argument |
Description |
|---|---|
|
olecontrol |
The name of the OLE control. |
|
filename |
A string whose value is the name of the |
Return Values
Integer. Returns 0 if it succeeds and one of the following
negative values if an error occurs:
-
-1 File not
found -
-9 Other error
If any argument’s value is null,
InsertFile returns null.
Usage
The contents of the specified file is embedded in the OLE
object. There is no further link between the object in PowerBuilder
and the file.
Examples
This example creates a new OLE object in the control ole_1.
It is an Excel object and contains data from the spreadsheet EXPENSE.XLS:
|
1 |
integer result |
|
1 |
result = ole_1.<span>InsertFile</span>("c:xlsexpense.xls") |