VB6中行尾分号会对代码执行产生哪些影响?
- 内容介绍
- 文章标签
- 相关推荐
本文共计300个文字,预计阅读时间需要2分钟。
在单行代码的末尾添加一个分号会影响代码的可读性,但通常不会对代码的功能产生直接影响。以下是对您提供的代码内容的简化:
在代码末尾添加分号,会影响代码的格式,但不影响其功能。例如:Printer.Print Customer: + strCustomerName + ( + strCustomerCode + ) ;在Print statement结束时,通常默认使用CRLF(换行符和回车符)。
在一行代码的末尾加一个分号有什么影响?我在接下来的一些代码中看到了这个:
Printer.Print "Customer: " & strCustomerName & " (" & strCustomerCode & ")";
一个 ;在
Print statement结束时抑制通常的默认CRLF:
charpos – Specifies the insertion point for the next character. Use a semicolon to position the insertion point immediately after the last character displayed. Use Tab(n) to position the insertion point to an absolute column number. Use Tab with no argument to position the insertion point at the beginning of the next print zone. If charpos is omitted, the next character is printed on the next line.
(我的重点)
我找不到Printer.Print的参考(如果你点击“方法”链接here,它没有列出),但我希望它做同样的事情.
本文共计300个文字,预计阅读时间需要2分钟。
在单行代码的末尾添加一个分号会影响代码的可读性,但通常不会对代码的功能产生直接影响。以下是对您提供的代码内容的简化:
在代码末尾添加分号,会影响代码的格式,但不影响其功能。例如:Printer.Print Customer: + strCustomerName + ( + strCustomerCode + ) ;在Print statement结束时,通常默认使用CRLF(换行符和回车符)。
在一行代码的末尾加一个分号有什么影响?我在接下来的一些代码中看到了这个:
Printer.Print "Customer: " & strCustomerName & " (" & strCustomerCode & ")";
一个 ;在
Print statement结束时抑制通常的默认CRLF:
charpos – Specifies the insertion point for the next character. Use a semicolon to position the insertion point immediately after the last character displayed. Use Tab(n) to position the insertion point to an absolute column number. Use Tab with no argument to position the insertion point at the beginning of the next print zone. If charpos is omitted, the next character is printed on the next line.
(我的重点)
我找不到Printer.Print的参考(如果你点击“方法”链接here,它没有列出),但我希望它做同样的事情.

