Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Percent and Ampersand symbol in vb6 function call

Tags:

vb6

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
like image 901
Pat Avatar asked Dec 03 '25 23:12

Pat


1 Answers

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

like image 126
Hanlet Escaño Avatar answered Dec 09 '25 03:12

Hanlet Escaño



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!