Bind: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:bind}} '''#bind''' is a ZZT-OOP command which allows replacing the currently executed Object code with that of a different Object present on the board....") |
No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:bind}} | {{DISPLAYTITLE:bind}} | ||
'''#bind''' is a [[ZZT-OOP]] command which allows replacing the currently executed [[Object]] code with that of a different Object present on the board. To do so, it takes a single parameter - the name of the Object whose code is to be used. | '''#bind''' is a [[ZZT-OOP]] command which allows replacing the currently executed [[Object]] code with that of a different Object present on the board. To do so, it takes a single parameter - the [[object name|name of the Object]] whose code is to be used. | ||
While it is common for objects that use '''#bind''' to have it be their only command, that does not need to be the case. Objects can use [[walk|#walk]] before binding to set a different [[flow]] direction, [[cycle|#cycle]] to give themselves a different speed, <code>/i</code> to delay the start of execution, or whatever else suits one's needs. | |||
With external editors it is possible to "pre-bind" an object to another without needing to use this command (even if the other object doesn't have a proper name!). | |||
== Bugs == | == Bugs == |
Revision as of 07:59, 13 February 2021
#bind is a ZZT-OOP command which allows replacing the currently executed Object code with that of a different Object present on the board. To do so, it takes a single parameter - the name of the Object whose code is to be used.
While it is common for objects that use #bind to have it be their only command, that does not need to be the case. Objects can use #walk before binding to set a different flow direction, #cycle to give themselves a different speed, /i
to delay the start of execution, or whatever else suits one's needs.
With external editors it is possible to "pre-bind" an object to another without needing to use this command (even if the other object doesn't have a proper name!).
Bugs
- In unmodified ZZT, #bind always causes the memory allocated by previously used code to be freed, without checking if the code is also bound to other Objects. As this does not clear the memory or invalidate the pointer to said code, execution can continue as normal. However, any dynamic memory allocation - such as opening text windows - may cause corruption and instability.
ZZT-OOP | |
---|---|
Prefixes |
|
Messages | |
Directions | |
Flags | |
Commands |