How to convert number to ASCII Code

neramitneramit Member Posts: 46
I want to know about convert number to ASCII Code
Exsample
65 = 'A'

if everybody know please tell me

](*,) :?:

Comments

  • ara3nara3n Member Posts: 9,257
    just find get an ascii table and do the matching write a function to which you pass the number and it returns the character or string. a simple case statement in function will do it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
    [Posted in wrong forum. Topic moved from Navision Tips & Tricks to Navision]
  • neramitneramit Member Posts: 46
    Thank a lot. :wink:
  • jmjm Member Posts: 156
    Hi,

    try this:
    MESSAGE('Number: %1 -> Character: %2',65,Num2ASCII(65));
    
    Num2ASCII(piNum : Integer) : Text[1]
    
    IF piNum < 256 THEN BEGIN
      SingleChar := piNum;
      EXIT(FORMAT(SingleChar));
    END ELSE
      EXIT('');
    
    br
    Josef Metz
    br
    Josef Metz
  • krikikriki Member, Moderator Posts: 9,118
    Or also:

    Variable : txt1Char:Text[1]
    txt1Char := 'X'; // this line, you need only yo do once.
    txt1Char[1] := 65;
    message('<%1>',txt1Char);
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.