3

将带有 % 符号的整数 DataValue% 传递给函数是什么意思?这与没有“%”的情况下仅传递有什么不同

另外,传递 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
4

1 回答 1

5

当您使用%时,它是一种非常“Visual Basic”的方式来指定数据类型,%即整数。以下是其他一些类型:

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

更多信息: http: //support.microsoft.com/default.aspx ?scid=kb;en-us;191713

于 2013-07-02T20:59:13.203 回答