代码之家  ›  专栏  ›  技术社区  ›  BlueRaja - Danny Pflughoeft

感叹号!!)在VB.NET

  •  8
  • BlueRaja - Danny Pflughoeft  · 技术社区  · 15 年前

    以下代码由设计器生成:

    Me.lblXRay.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    

    什么? 8.0! 意思是?

    4 回复  |  直到 8 年前
        1
  •  14
  •   Hans Passant    15 年前

        Dim singleVar! = 1.2!
        Dim doubleVar# = 1.2#
        Dim decimalVar@ = 1.2@
        Dim integerVar% = 12%
        Dim longVar& = 12&
        Dim stringVar$ = "12"
    
        Function ReturnsString$(ByVal takesLong&)
    
        3
  •  5
  •   Peter Mortensen Pieter Jan Bonestroo    13 年前
        4
  •  0
  •   Gerhard Powell    8 年前

    $ : String
    % : Integer (Int16)
    & : Long (Int32)
    ! : Single
    # : Double
    @ : Decimal
    

    &H : Hex
    &O : Octal
    

    reference

    reference

    S : Short (Int16)
    I : Integer (Int32)
    L : Long (Int64)
    F : Single
    R : Double
    D : Decimal