I have noticed that sometimes new users misunderstand how the "if"
command works. I see someone write code like:
if(condition) then(action)
but this code only runs once in their "new game" script, and they wonder
why "action" fails to happen each and every time that "condition" comes
true
This wouldn't work until script multitasking was supported, but what if
there was a flow control command like:
script, my script, begin
whenever(condition) do(action)
end
This would be shorthand for writing:
script, my script, begin
whenever loop
end
script, whenever loop, begin
while(true) do(
if(condition) then(action)
wait(1)
)
end
Does that seem like a thing that would be worth having? It seems pretty
cool to me... but I can't think of any other language* with a similar
flow control structure, which makes me wonder if it has already been
tried and declared harmful by older wiser minds.
(* actually, I can think of one language that has something like this.
The machine language for the ancient Daytronics System-10 mainframe has
the EXU command which executes code any time a logic bit changes state.
This is also the one and ONLY flow control of any kind that the language
supports. All other flow control patterns have to be painstakingly
cobbled together with a series of EXU commands and bit flips)
---
James
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org