Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

What does a dollar sign do when it's affixed to the end of a variable?

nethervoidnethervoid Posts: 4Member
I'm working with some code patched together from about 5 different people, and I came across a set of variables each having a dollar sign at the end of their names. ????? Anybody know what this implies or does?

Never seen this before.

Comments

  • PavlinIIPavlinII Posts: 404Member
    : I'm working with some code patched together from about 5 different people, and I came across a set of variables each having a dollar sign at the end of their names. ????? Anybody know what this implies or does?
    :
    : Never seen this before.
    :
    Hi,
    $ at the end of variable means that the variable has type of string.
    Theese pairs means the same
    [code]Dim StrVariable As String
    Dim StrVariable$
    -
    Dim IntVariable As Integer
    Dim IntVariable%
    -
    Dim LngVariable As Long
    Dim LngVariable&
    -
    Dim DecVariable As Decimal
    Dim DecVariable@
    -
    Dim SngVariable As Single
    Dim SngVariable!
    -
    Dim DblVariable As Double
    Dim DblVariable#[/code]
    Use named declaration of variables. When you use character resolution, you may have some problems..
    VB - without "option explicit" - when you define s$ and use s, you made new s variable of variant, it will cause a lot of problems to you..
    VB - with "option explicit" - compiler will tell you that you've used s variable (and defined s$) but you still have to write $ character each time you need your variable and your code is not clear a and readable..
    VB.NET - you can use Dim s$ to declare string and then use "s" to work with it, this is not danger but code is not "clear"..


    [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]

    [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]


Sign In or Register to comment.