Options

Nav 2016 Development Environment

jrejre Member Posts: 10
edited 2016-05-26 in NAV Three Tier
Hello ,

Till Version 2015 it was possible to save Special characters in C/AL Code. Example: startpos := 'š';. In Version 2016 it is not. After saving the object it is replaced with some other value (here it is saved as : startpos := 's';). Does anybody know the reason of this? Is it an Error in Version 2016 ?
Thanks for your Feedback.

Regards

JRE

Comments

  • Options
    krikikriki Member, Moderator Posts: 9,098
    I used something like this in older versions:

    Like for putting a tab-char in a textvar:

    TheTab as Text1

    TheTab := 'x';
    TheTab[1] := 9;


    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    amaro88amaro88 Member Posts: 2
    Hi,

    I have the same problem than "jre". I dont understand your solution, could you explain it, please? Anyway, I opened another thread.

    Regards.
  • Options
    krikikriki Member, Moderator Posts: 9,098
    If I know the ASCII value of what I want to use, I create a text-variable with a value in it to have the text variable initialized. Then I overwrite it with the ASCII-value I want.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    vaprogvaprog Member Posts: 1,128
    Well, I could not figure out a solution for the character 'š'. This character is not in ISO 8859-1, so there is no integer value in the range 0..255 for it, because NAV appears to interpret that as beeing a codepoint within ISO 8859-1. Note that ISO 8859-1 is very much like cp1252 (Windows Western European ANSI codepage), but 'š' happens to be in a range which differs (in fact, it is in cp1252 but not in ISO 8859-1).

    For unicode characters with codepoints greater that 255, you can use that, but š is U+0161.

    The character is actually preserved in an MLCaption, and even displayed correctly.

    The character is also preserved in an ML Text Constant, and in any other property value, but this time, it is not properly displayed.

    I guess, the only solution is to mess with DotNet string encodings, or read your text from a file or blob, with the proper encoding in place, but I did not try that.
  • Options
    jrejre Member Posts: 10
    Hallo amaro88,

    The workaround is exactly what kriki wrote.

    You can find the Ascii value If you have an old Version of Navision where these characters work, you can do EVALUATE(Asciivalue,FORMAT(startPos,0,'<NUMBER>'));
    Use this Ascii Value for startpos(Example: startpos := 353;)

    Regards,
    JRE

  • Options
    jrejre Member Posts: 10
    Asciivalue is integer
    startpos is char
Sign In or Register to comment.