ON在QBasic中做什么?(What does ON do in QBasic?)

编程入门 行业动态 更新时间:2024-10-26 06:34:56
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, 1900

Can 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 1900

See this article for more information.

For more options you would probably turn to a switch statement in more modern languages.

更多推荐

本文发布于:2023-08-04 06:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1412449.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中做   QBasic

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!