The following figure shows the syntax of SysDestroyObject:

Syntax:  SysDestroyObject(object_name)

where

object_name     Name of the object that is either the object's ID
                assigned to the object when it was created, or the
                fully qualified path name of the object to be destroyed.

The following sample code shows how to destroy and recreate the color palette objects. To destroy the objects first, the setup string must be modified to allow the color palette objects to be destroyed. The setup string NODLETE = NO must be changed to NODELETE = YES, so that the object can be destroyed.

/***/
call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
call SysLoadFuncs

/* ColorObjectId  = "<WP_CLRPAL>" */
ColorObjectId1 = "<WP_LORESCLRPAL>"
ColorObjectId2 = "<WP_HIRESCLRPAL>"

ColorObjectLocation = "<WP_CONFIG>"
call SysSetObjectData ColorObjectId1, "NODELETE=NO"
call SysSetObjectData ColorObjectId2, "NODELETE=NO"

/* Call SysDestroyObject ColorObjectId */
call SysDestroyObject ColorObjectId1
call SysDestroyObject ColorObjectId2

rc = SysCreateObject('WPColorPalette',,
        'Solid Color Palette',,
        '<WP_CONFIG>',,
        'AUTOSETUP=LORES;NODELETE=NO;OBJECTID='ColorObjectId1,,
        'update');

rc = SysCreateObject('WPColorPalette',,
        'Mixed Color Palette',,
        '<WP_CONFIG>',,
        'AUTOSETUP=HIRES;NODELETE=NO;OBJECTID='ColorObjectId2,,
        'update');


[Back] [Next]