有趣搞笑的历史短故事:VB中的SPC()函数怎么用?

来源:百度文库 编辑:高校问答 时间:2024/05/09 08:21:42

Spc 函数确定在文件或立即窗口中的输出位置
例子:

' Spc 函数可以和 Print # 语句一起使用。
Open "TESTFILE" For Output As #1 ' 打开输出文件。
Print #1, "10 spaces between here"; Spc(10); "and here."
Close #1 ' 关闭文件。

下列语句在显示到调试窗口(使用 Print 方法)的文本之前加 30 个空格。

Debug.Print Spc(30); "Thirty spaces later. . ."

查MSDN

打印或者输出n个空格