这个问题在这里已经有了答案:
What do ! and # mean when attached to numbers in VB6?
(3 个回答)
8 年前关闭。
在我试图弄清楚的一些代码中有以下内容:
For I& = 1 To...
我对变量后的 & 不熟悉。那代表什么?
更进一步后research ,看起来 I& 被定义为 LONG 类型。现在我的问题是他们为什么要这样做?它是矫枉过正还是只是遗留代码?
最佳答案
传统的 BASIC 语言有多种声明变量的方法。您可以将数据类型后缀($、%、&、! 或 #)用于变量名称
x$ = "This is a string" ' $ defines a string
y% = 10 ' % defines an integer
y& = 150 ' & defines a long integer
y! = 3.14 ' ! defines a single
y# = 12.24 ' # defines a double
关于变量后的 vb6 & 字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5329043/