Function xsSet
Set a property or item of an instance.
void xsSet
(
scope xs .bindings .xsMachineRecord* the,
const(xs .bindings .xsSlotRecord) this_,
short id,
const(xs .bindings .xsSlotRecord) slot
);
Parameters
Name | Description |
---|---|
the | A machine |
this_ | A reference to the instance that will have the property or item |
id | The identifier of the property or item to set |
slot | The value of the property or item to set |
Examples
In ECMAScript:
foo = 0
this .foo = 1
this[0] = 2
In D:
xsSet(xsGlobal, xsID_foo, xsInteger(0));
xsSet(xsThis, xsID_foo, xsInteger(1));
xsSet(xsThis, 0, xsInteger(2));