zap

From Wiki of ZZT
Revision as of 17:28, 7 February 2021 by Asie (talk | contribs) (Created page with "{{DISPLAYTITLE:zap}} '''#zap''' and '''#restore''' are ZZT-OOP commands for disabling labels. '''#zap label''' will disable the first active occurence of label by turning...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

#zap and #restore are ZZT-OOP commands for disabling labels. #zap label will disable the first active occurence of label by turning it into a comment, while #restore label will turn all comments "label" back into labels. (with caveats - see below). They allow selective disabling of labels on a given Object, as well as multiple meaningful destinations of the same label name.

Label restoration quirks

  • #restore does not work for labels located on the first line, as it relies on a newline preceding the label to locate it.
  • #restore fails to restore labels after the first occurence if the line succeeding them starts on an alphabetic character or an underscore.
  • #zap restart and #restore restart will always edit the second character of the targetted Object's code into ' or : respectively.
  • #zap and #restore edit the code of an Object - this means that, if the code is being used by other bound Objects, labels will be changed on all of them.