$ @ and % when prefixing variable RRS feed

  • Question

  • User1697685043 posted

    Here is the query from one of my team mate. Can some one answer to this: What do the symbols $ @ and % mean when prefixing a variable?


    Wednesday, December 19, 2012 12:46 PM

All replies

  • User502568702 posted

    It depends what you are talking about. I do not know if it is SQL or .NET.

    In .NET you will see in some objects @VarName when your variable names is the same as a system reserved word. I this happening quite often when consuming web services as the WSDL may define a variable with the same name as a reserved word. If you are writing SQL you can use @varname inside your text to specify that it is a parameter.

    $ it is used in PHP, but have not see it in .NET. $ is also used when referecing jQuery in javascript client code.

    % I have not seen in .NET either unless it is for a wild character in an SQL statement or you are doing a MOD within 2 numbers var x = 3 % 6

    Wednesday, December 19, 2012 12:57 PM
  • User1697685043 posted

    Actually the query is on C++

    Wednesday, December 19, 2012 1:05 PM