vb6函数调用中的百分比和符号符号

Pat*_*Pat 3 vb6

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

通过PortNum%vs 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
Run Code Online (Sandbox Code Playgroud)

Han*_*año 5

使用时%,它是一种非常"Visual Basic"的指定数据类型的方式,%即整数.以下是其他一些类型:

% : Integer
& : Long
# : Double
! : Single
@ : Currency
$ : String
Run Code Online (Sandbox Code Playgroud)

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

  • 我不能强调这些运营商是多么邪恶.使用明确命名的强制转换函数. (4认同)