Significance of an ampersand in VB6 function name?

十年热恋 提交于 2019-11-30 11:26:02

It means that the function returns a Long (i.e. 32-bit integer) value.

It is equivalent to

Declare Function ShellExecute(...) As Long

The full list of suffixes is as follows:

Integer %
Long    &
Single  !
Double  #
Currency @
String  $

As Philip Sheard has said it is an indentifier type for a Long. They are still present in .Net, see this MSDN link and this VB6 article

From the second article:

The rules for forming a valid VB variable name are as follows:

(1) The first character must be a letter A through Z (uppercase or lowercase letters may be used). Succeeding characters can be letters, digits, or the underscore (_) character (no spaces or other characters allowed).

(2) The final character can be a "type-declaration character". Only some of the variable types can use them, as shown below:

Data Type  Type Declaration Character  

String         $  
Integer        %  
Long           &  
Single         !  
Double         #  
Currency       @    

Use of type-declaration characters in VB is not encouraged; the modern style is to use the "As" clause in a data declaration statement.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!