callfunc.bas
来自「这是一个简易的basic语言解释器, 可供我们学习和改进.」· BAS 代码 · 共 35 行
BAS
35 行
rem ----------------------------------------------------rem CallFunc.BASrem ----------------------------------------------------Print "CallFunc.BAS -- Test BASIC User-defined Function Statements"Print "The next printed line should be from the Function."Printtestvar = 17x = TestFnc( 5, "Hello", testvar )PrintPrint "This is back at the main program. "Print "The value of variable <testvar> is now "; testvarPrint "The returned value from the function is "; xPrint "Did it work?"Endrem ----------------------------------------------------rem Subroutine TestFncrem ----------------------------------------------------Function TestFnc( xarg, yarg$, tvar ) Print "This is written from the Function." Print "The value of variable <xarg> is"; xarg Print "The value of variable <yarg$> is "; yarg$ Print "The value of variable <tvar> is "; tvar tvar = 99 Print "The value of variable <tvar> is reset to "; tvar TestFnc = xarg + tvar Print "The Function should return "; TestFncEnd Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?