2 Print "What is your name"
input nameperson$
Print "What is your Dad's name"
input ageperson$
Print "Your Name is ";nameperson$;" ";ageperson$
GOTO 2
Run Code Online (Sandbox Code Playgroud)
为什么这段代码在 BASIC 256 中不起作用?我已经在QB64中尝试过并且有效。
距离我上次使用 BASIC 编程已经有很多年了,但我记得该语言有不同的风格(C、Pascal 和其他语言也是如此)。
我在 google 上搜索了一些QB64和Basic 256:简短的答案是QB64的 BASIC 风格支持行号,但Basic 256实现了一种不支持行号的较新风格的 BASIC。
为了GOTO在BASIC 256中使用,您必须使用标签(任何标识符后跟冒号“:”)
thisIsALabel: Print "What is your name"
input nameperson$
Print "What is your Dad's name"
input ageperson$
Print "Your Name is ";nameperson$;" ";ageperson$
GOTO thisIsALabel
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
350 次 |
| 最近记录: |