Percent and Ampersand symbol in vb6 function call

vb6

Solution

When you use `%`, it is a very "Visual Basic" way of specifying the data type, `%` meaning integer. Here are some other types:

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

More info: http://support.microsoft.com/default.aspx?scid=kb;en-us;191713

Problem

What does it mean to pass in an integer DataValue% with a % symbol into a function? How is this different from just passing in without "%" Also what does it mean to passin 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 ```

Original source