The following figure shows the syntax of SysCreateObject:
Syntax: SysCreateObject(class_name,
title,
location,
<setup_string>,
<option>)
where
class_name Name of the Workplace Shell class of which the object
is a member of, such as WPFolder.
title New object's title.
location Either an object ID, such as <WP_DESKTOP>, or a fully
qualified path name.
setup_string A series of keynames that change the behavior of the
object. The keynames are separated by a semicolons
and values are separated by commas.
option An action to be taken if the object class already
exists. The action could be FAIL, REPLACE, or UPDATE.
The following sample code creates two objects, one of the class WPFolder and one of the class WPProgram. The program object MyProgram is inserted into the Folder MyFolder. The location specified by MyProgram is the same as the object ID for MyFolder.
/* */
call RxFuncAdd "SysLoadFuncs", "rexxutil", "SysLoadFuncs"
call SysLoadFuncs
say SysCreateObject("WPFolder",,
"MyFolder",,
"<WP_DESKTOP>",,
"OBJECTID=<Prefix_MyFolder>")
say SysCreateObject("WPProgram",,
"MyProgram",,
"<Prefix_MyFolder>",,
"EXENAME=C:\PGM\PGM.EXE;ASSOCFILTER=*.TXT" ,,
"OBJECTID=<Prefix_MyProgram>")