Menaing of the '$' after a function call RRS feed

  • Question

  • I was just wondering what is the meaning of placing the '$' character after a function call

    eg: Dim time as string = Format$(Now, "Long Time")

    and what is funny is that it is of no use (as far as i can see)

    can someone point out its use please.


    Sunday, July 24, 2011 5:21 PM


All replies

  • Paul,

    It is an old VB operator, it does like you say, but if somebody has it still in his program there is no need to delete it, many programmers are very slowly  with stopping old habits, and as it not hurts then why go in discussion.



    • Proposed as answer by jwavila Sunday, July 24, 2011 5:41 PM
    • Marked as answer by Paul Hallak Sunday, July 24, 2011 5:49 PM
    Sunday, July 24, 2011 5:38 PM
  • Thanks for replying!

    I was just making sure it hadn't any additional use i didn't notice!


    Sunday, July 24, 2011 5:50 PM
  • It is allowed to remind yourself that the result being returned is a string.

    It goes way, way back to the early days and it's probably not a good idea to use it.  You can optionally use it in the declaration of a function or variable and/or the references to the function or variable.

    Other related character suffixes are:

    # - result is a double

    ! - result is a single

    % - result is an integer

    @ - result is a decimal

    & - result is a long

    Convert between VB, C#, C++, & Java (http://www.tangiblesoftwaresolutions.com)
    Sunday, July 24, 2011 11:14 PM