2013-07-02 40 views
3

將帶有%符號的整數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 

回答

5

當您使用%,它是指定的數據類型,%意味着整數的一個非常「的Visual Basic」的方式。 下面是一些其他類型:

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

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

+1

的'@''是Currency' – Bob77

+4

我不能強調不夠的經營者的邪惡是。使用明確命名的投射功能。 – UnhandledExcepSean