CreateNamed - cObject

Creates an object based on the passed Class Id and assigns it a name Name based on a passed name

Type: Function

Return Data Type: Handle

Parameters: Integer iClassId String sName

ParameterDescription
iClassIdThe Class Id of the object to be created.
sNameObject name


Return Value

The object handle of the newly created object.


Syntax
Function CreateNamed Integer iClassId String sName Returns Handle

Call: Get CreateNamed iClassId sName to HandleVariable


Description

Creates an object based on the passed Class Id and assigns it a name Name based on a passed name.

Get CreateNamed (RefClass(cImageList32)) "oImageList" to hoImage

CreateNamed behaves exactly the same as Create, except it allows you to give you dynamic object a name. Create always sets the new created object name to "oObject". CreateNamed lets you set a more meaningful name.

You never send messages to dynamic objects via their name, which is why it does not matter internally what the name of the object is. However, using CreateNamed creates objects that are much easier to debug. If you've ever tried to figure out exactly what the "oObject" the debugger is referring to, the reason for the purpose of this function should be obvious.

Note that this is equivalent to:

Get Create (RefClass(cImageList32)) to hoImage
Set Name of hoImage to "oImageList"