vb 中:=符号是什么意思?

比如这个:.Application.Selection.EndOf unit:=wdCharacter
2024-12-03 21:11:45
推荐回答(5个)
回答1:

:=是VB中的可选参数,按名传递。我见过的都是在<属性>中给参数赋值用:=符号,比如这个MSDN中的例子
Visual Basic
Copy Code
' Declares a class member foreachstructure element.
< StructLayout( LayoutKind.Sequential, CharSet := CharSet.Auto )> _
PublicClass FindData
Public fileAttributes AsInteger = 0
' creationTime was a by-value FILETIME structure.
Public creationTime_lowDateTime AsInteger = 0
Public creationTime_highDateTime AsInteger = 0
' lastAccessTime was a by-value FILETIME structure.
Public lastAccessTime_lowDateTime AsInteger = 0
Public lastAccessTime_highDateTime AsInteger = 0
' lastWriteTime was a by-value FILETIME structure.
Public lastWriteTime_lowDateTime AsInteger = 0
Public lastWriteTime_highDateTime AsInteger = 0
Public nFileSizeHigh AsInteger = 0
Public nFileSizeLow AsInteger = 0
Public dwReserved0 AsInteger = 0
Public dwReserved1 AsInteger = 0
< MarshalAs( UnmanagedType.ByValTStr, SizeConst := 256 )> _
Public fileName AsString = Nothing
< MarshalAs( UnmanagedType.ByValTStr, SizeConst := 14 )> _
Public alternateFileName AsString = NothingEndClass 'FindData

PublicClass LibWrap
' Declares a managed prototype for the unmanaged function.
DeclareAutoFunction FindFirstFile Lib"Kernel32.dll" _
( ByVal fileName AsString, <[In], Out> ByVal findFileData As _
FindData ) As IntPtr
EndClass 'LibWrap

回答2:

就是赋值。一般只出现在用VB操作WORD等软件的代码中

回答3:

VB中没有这个符号, 这个是Delphi的. 是赋值的意思

回答4:

赋值

回答5:

VBA中的代码了