component <ident>
or
component <assign> { , <assign> ... }
Creates one or more component identifiers. Component identifiers are pointers to external objects.
<assign>
<ident> = <component>
<ident>
The name of the identifier.
<component>
Another component identifier or a component function which creates an
external object.
None
Component identifiers are not usable until they point to a valid external object. Until then they have a null value.
External objects are created by component functions, one of which is oleobj which instantiates an OLE Automation or ActiveX objec. On instantiation, an external object is given a unique handle of the form obj<x> where x is a hexadecimal number. Any component then pointing to the external object has the value obj<x>. The object may also be referenced via obj<x>.
Another type of external object is an xml object created by the xmlobj function, enabling xml data file traversal.
Deleting a component identifier will not delete the external object to which it points. This must be done using the component member function kill. When an external object is killed all component identifiers pointing to it are automatically nullified, but not deleted.
Create a new un-initialized component identifier.
component myobj
Instantiate an ActiveX object and create a component identifier pointing to it. This is in fact the Windows Media Player.
component mm = oleobj('WMPlayer.ocx')
Create another component identifier pointing to the same object.
component mm2 = mm
Since this component is a media player, we can use one of the API calls which comes with the ActiveX component to play an mp3 audio file.
mm.url = 'c:/temp/VoodooChile.mp3'
Delete the object.
mm.kill
Commands: |
|
Functions: |
|
Identifiers: |
obj# (component) |
Structures: |