SysCreateObject
Function:
Syntax:
result = SysCreateObject(classname, title, location
<,setup> <,option>)
classname
The name of the object class.
title
location
The object location. This can be specified
as either an object ID (for example, <WP_DESKTOP>) or a file system
path (for example, C:\bin\mytools).
setup
A
WinCreateObject setup string.
option
The
action taken if the object already exists. Allowed options are: "fail",
"replace" (delete existing object and create new object), and "update" (update
the settings of the existing object). Only the first letter of the option
is needed; all others are ignored.
result
The
return code from WinCreateObject. This returns 1 (TRUE) if the object was
created and 0 (FALSE) if the object was not created.
Purpose:
Create a new instance of an object class.
Examples:
/* Code */
If SysCreateObject("WPFolder","Mail Folder","<WP_DESKTOP>")
Say 'Mail Folder successfully created'
/* Create a folder object, and then create a program object */
/* in that folder.*/
If SysCreateObject("WPFolder", "MyFolder", "C:\",,
"OBJECTID=<MYFOLDER>") Then Do
If SysCreateObject("WPProgram", "MyProgram", "<MYFOLDER>",,
"EXENAME=C:\TOOLS\MYPRG.EXE") Then
Say 'Folder "MyFolder" and Program "MyProgram" have been created'
Else Say 'Could not create program "MyProgram"'
End
Else Say 'Could not create folder "MyFolder"'
[Back: SysCopyObject, SysCreateShadow, and SysMoveObject]
[Next: SysCurPos]