Difference between revisions of "Talk:Label"
imported>TS7 (Removing all content from page) |
imported>Diarrhoe |
||
Line 1: | Line 1: | ||
== Questions on the use of Label/GoTo == | |||
Since my computer lacks in a proper graphic card, I can't test it on my own: | |||
1) In the article, it says ''label'' is used to create a certain label ID. This sounds to me like the command has to be run before ''goTo'' can be called. Is that right? Because it would be a good way to exclude certain parts of a script without using ''if'' conditions for the sake clarity. | |||
For instance | |||
short Var | |||
;... | |||
if Var == 0 | |||
GoTo 1 | |||
endif | |||
; code to exclude | |||
Label 1 | |||
;... | |||
as a workaround for | |||
short Var | |||
;... | |||
if Var | |||
; code to exclude | |||
endif | |||
;... | |||
Does this work as expected? This would be useful especially for long exclusions. | |||
2) Is ''label/goTo'' bound to only one blocktype or is it possible to switch between several blocks. | |||
For example | |||
Begin MenuMode | |||
Label 1 | |||
message "text" | |||
end | |||
Begin GameMode | |||
GoTo 1 | |||
end | |||
Does the message also occur in GameMode? Can't imagine that, since it would make those blocktypes useless, but it's left open in the article.<br>[[User:Diarrhoe|Diarrhoe]] 12:09, 5 May 2011 (EDT) |
Revision as of 11:09, 5 May 2011
Questions on the use of Label/GoTo
Since my computer lacks in a proper graphic card, I can't test it on my own:
1) In the article, it says label is used to create a certain label ID. This sounds to me like the command has to be run before goTo can be called. Is that right? Because it would be a good way to exclude certain parts of a script without using if conditions for the sake clarity. For instance
short Var ;... if Var == 0 GoTo 1 endif ; code to exclude Label 1 ;...
as a workaround for
short Var ;... if Var ; code to exclude endif ;...
Does this work as expected? This would be useful especially for long exclusions.
2) Is label/goTo bound to only one blocktype or is it possible to switch between several blocks.
For example
Begin MenuMode Label 1 message "text" end Begin GameMode GoTo 1 end
Does the message also occur in GameMode? Can't imagine that, since it would make those blocktypes useless, but it's left open in the article.
Diarrhoe 12:09, 5 May 2011 (EDT)