Jaa


Difference between " and ' ?

We have been asked whether there is any difference between the two types of quotes that can be used by Ax. The answer is very simple: X++ makes absolutely no distinction between the two. The reason that there are two quote characters is to facilitate constructs themselves containing quote characters, like

str s = ‘<MyTag attr="hello">’;

Writing this with only one quote character would be difficult to read because escape characters would have to be used to distinguish the quotes defining the extent of the string from those that occur in the string, as

str s = "<MyTag attr=\"hello\">";

That said, the application community has best practices that mandate that programmers use '(single quotes) for text that cannot appear on UI, like

System.Int32 myVar = CLRInterop::CLRNull('System.Int32');

Whilst text that does should use double quotes for text like

myButton.Label = "@SYS12345";

Comments

  • Anonymous
    June 28, 2010
    I believe there is a 'best practice check' that you can switch on, which insists on @labels always being used inside double quotes. With that switched on, you can use double quotes for UI-related messages, and have it report back if you have forgotten to use labels anywhere.

  • Anonymous
    April 18, 2011
    For more difference between articles please visit www.differencebetween.com

  • Anonymous
    September 11, 2011
    hi... how to convert customer into vendor?

  • Anonymous
    July 22, 2012
    that was boring can't you make it a bit smaller.

  • Anonymous
    November 30, 2012
    Amir.... That wasn't boring to me. To me, it made a point. And whileI agree that the subject isn't the most attention getting, ;-), It IS A good point. :{ ) (Mustache)