小编use*_*569的帖子

Commodore 64 BASIC中的多线功能

所以,我想在Commodore 64 BASIC中编写更大的函数.到目前为止,从我从其他来源(例如各种C64 wiki,以及C64本身的用户手册)看到的,函数定义只能是一行.也就是说,我似乎无法在BASIC中找到括号中的类似构造/其他语言用于描述代码块的其他内容.

有谁知道我如何在BASIC中编写多行代码块?

单行功能示例:

10 def fn X(n) = n + 1
20 print fn X(5) rem Correctly called function. This will output 6
Run Code Online (Sandbox Code Playgroud)

但我做不了类似的事情:

10 def fn X(n) = 
20 n = n + 1
30 print n
40 rem I'd like the definition of function X to end at line 30 above 
50 fn X(5) rem Produces syntax error on line 40
Run Code Online (Sandbox Code Playgroud)

感谢您的时间!

basic function c64 multiline commodore

6
推荐指数
1
解决办法
704
查看次数

标签 统计

basic ×1

c64 ×1

commodore ×1

function ×1

multiline ×1