添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I keep getting the error “Argument is not optional” when running the following

REM  *****  BASIC  *****
Sub Main
    Call nRight(5)
End Sub
Sub nRight(n as Integer)
    print "n = ",n
End Sub

What am I doing wrong?

Thanks

You will get that error if your insertion point is within Sub nRight when you run the macro.

To avoid the error, position your insertion point within Sub Main before you run the macro, e.g. by clicking within the line ‘Call nRight(5)’.