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 (5)

  1. Paul says:

    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.

  2. Andrew says:

    For more difference between articles please visit http://www.differencebetween.com

  3. vijaya says:

    hi…

    how to convert customer into vendor?

  4. Amir says:

    that was boring can't you make it a bit smaller.

  5. Remembrance Raymond says:

    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)