Options

finding out ascii value of characters

jksjks Member Posts: 277
Hi all,

I want to find out ascii value of characters. how can i do that?

I have tried following options but none worked.

1. ch='A'
message('%1','ch');
2.
string='ABC';
message(strsubstno('%1 %2 %3',string[1],string[2],string[3]))

I searched download section as well but not found any solution.

Please help.

Comments

  • Options
    tragtrag Member Posts: 23
    Hi jks,

    relying on the C/SIDE help you can use the CHAR datatype also vice versa to get the ordinal value.

    For example:
    character: CHAR
    value: INTEGER
    
    character := 'A';
    value := character;
    MESSAGE('%1 has a value of %2', character, value);
    

    Regards
  • Options
    Timo_LässerTimo_Lässer Member Posts: 481
    Have you tried this:
    MyIntVar := MyCharVar;
    // or
    MyIntVar := MyTextVar[1];
    
    Message('%1',MyIntVar);
    
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • Options
    jksjks Member Posts: 277
    Thanks. It works.
Sign In or Register to comment.