ON在QBasic中做什么?(What does ON do in QBasic?)
我一直在研究一个项目,在这个项目中,我采用了一个旧程序并创建了一个新版本......问题是它是用Quick Basic编写的,它有一行我不明白的代码
ON FLAG% GOTO 1730, 1900谁能告诉我这是什么? 顺便说一句,我正在研究VisualBasic
I have been working on a project, in which I take an old program and create a new version of it .... The thing is that it is written in Quick Basic and it has a line of code that I don't understand
ON FLAG% GOTO 1730, 1900Can anyone tell me what this is ??? By the way I'm working on VisualBasic
最满意答案
它基本上是这种语句的简写语法:
IF FLAG% = 1 THEN GOTO 1730 ELSE IF FLAG% = 2 THEN GOTO 1900有关更多信息,请参阅此文章 。
对于更多选项,您可能会转向更现代语言的switch语句。
It is basically a shorthand syntax for this type of statement:
IF FLAG% = 1 THEN GOTO 1730 ELSE IF FLAG% = 2 THEN GOTO 1900See this article for more information.
For more options you would probably turn to a switch statement in more modern languages.
更多推荐
发布评论