vb6函数调用中的百分比和符号
问题描述:
将带有%符号的整数DataValue%传入函数是什么意思?这与刚刚通过没有“%”的情况有什么不同?vb6函数调用中的百分比和符号
另外,通过PortNum%和PortNum是什么意思?
Private Sub WritePortValue(ByVal DataValue As Integer)
' write the value to the output port
' Parameters:
' BoardNum :the number used by CB.CFG to describe this board
' PortNum& :the output port
' DataValue% :the value written to the port
ULStat& = cbDOut(BoardNum, PortNum&, DataValue%)
If ULStat& <> 0 Then
Stop
Else
lblShowValOut.Caption = Format$(DataValue%, "0")
End If
End Sub
答
当您使用%
,它是指定的数据类型,%
意味着整数的一个非常“的Visual Basic”的方式。 下面是一些其他类型:
% : Integer
& : Long
# : Double
! : Single
@ : Currency
$ : String
更多信息:http://support.microsoft.com/default.aspx?scid=kb;en-us;191713
的'@''是Currency' – Bob77
我不能强调不够的经营者的邪恶是。使用明确命名的投射功能。 – UnhandledExcepSean