End: Difference between revisions

From Wiki of ZZT
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:end}} '''#end''' is a ZZT-OOP command for ending code execution. It achieves this by setting the Object code position to -1. Execution can be restored b...")
 
 
Line 4: Line 4:
== Quirks ==
== Quirks ==


* Unlike its companion command [[restart]], '''#end''' does not act as a label that can be sent. Thus, the command <code>#all:end</code> will do nothing (except jumping to an <code>:end</code> label for objects that have it).
* The ZZT-OOP parser will treat the character 00h (a null terminator) as equivalent to '''#end'''. As object code strings are length-prefixed and not null-terminated, this allows storing 00h characters as part of the code and saving a few bytes per occurence.
* The ZZT-OOP parser will treat the character 00h (a null terminator) as equivalent to '''#end'''. As object code strings are length-prefixed and not null-terminated, this allows storing 00h characters as part of the code and saving a few bytes per occurence.


{{ZZT-OOP navbox}}
{{ZZT-OOP navbox}}

Latest revision as of 05:52, 24 October 2023

#end is a ZZT-OOP command for ending code execution. It achieves this by setting the Object code position to -1. Execution can be restored by sending a message to the affected Object.

Quirks

  • Unlike its companion command restart, #end does not act as a label that can be sent. Thus, the command #all:end will do nothing (except jumping to an :end label for objects that have it).
  • The ZZT-OOP parser will treat the character 00h (a null terminator) as equivalent to #end. As object code strings are length-prefixed and not null-terminated, this allows storing 00h characters as part of the code and saving a few bytes per occurence.