What does the $ symbol do in VBA?

后端 未结 5 1877
梦如初夏
梦如初夏 2020-12-04 16:15

For example:

variable1=Dir$(some_path)

vs.

variable1=Dir(some_path)

What is the difference?

Why n

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-04 16:17

    Here is a Cheat Sheet for DataTypes

    Variable End with:

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

    Start with:

    &H : Hex
    &O : Octal
    

    Comparison between VB and VB.Net (reference)

    Visual Studio .Net added Literal Types (reference)

    Value End with: (For more complete list, refer the the reference)

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

提交回复
热议问题