Ascii code in nav 2.6

JBeckJBeck Member Posts: 68
edited 2006-11-16 in Navision Financials
Hi,
Is there a function within Nav 2.6 that converts char code (0 - 255) into ascii code?

Thanks in advance
JBeck

Comments

  • JBeckJBeck Member Posts: 68
    Okay thanks.

    But how does it work?
  • KowaKowa Member Posts: 923
    JBeck wrote:
    Hi,
    Is there a function within Nav 2.6 that converts char code (0 - 255) into ascii code?
    If you define a CHAR variable and assign an integer value to it you only need the FORMAT function.
    MyChar := 13;
    MyText := FORMAT(MyChar);  
    
    will write a Carriage Return (CR) into a text variable.
    Kai Kowalewski
  • JBeckJBeck Member Posts: 68
    Well that's not really what i'm looking for.

    I'm trying to convert a decimal number into a ascii character.
    I need to give an ascii command to a device so that's why I need it.
    one command is ascii "^_" , which is 31 in decimal.
  • ara3nara3n Member Posts: 9,256
    That's what Kowa wrote in his example

    Char := 31;
    MyText := FORMAT(MyChar);

    would give your answer.

    Are you talking to the device through Serial port?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • JBeckJBeck Member Posts: 68
    I'm talking to the device through a comport.
    It's a Pole display...
  • ara3nara3n Member Posts: 9,256
    yep the code above will work
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • JBeckJBeck Member Posts: 68
    I tried it but still didn't get any results.
    The ascii "^_" (Ctrl _ ) is meant to clear my pole display. When I used the code I got 31 on my display. So actually I needed a function or somethin that would convert decimal numbers into ascii characters...
    I hope i can find a sollution for this problem [-o<

    Anyways, Lots of thanks to everyone helping me.
    I'm still open for suggestions.
  • kinekine Member Posts: 12,562
    You can try this:
      TextVar := ' ';
      TextVar[1] := 31;
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,256
    You could send it zeros as last solution. or space (10) or just empty string or space (32).
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.