Options

ASCII characters as an output from NAV

aktharakthar Member Posts: 30
edited 2012-01-12 in NAV Three Tier
Dear All,

We have a requirement from one of our client, client wants to upload the payments file in the banking software where the payment file format was given by the bank. We are in process of developing the requirement through XML object, according to the payment format shared by bank there are some special characters in the file like smile symbol and heart symbol, these symbols has meaning to the file according to bank.

Can anyone help me, that how we can generate ASCII Characters i.e. 'smile' and 'heart' symbol

Waiting for all your valuable feedback

Thanks and Regards
Abdul Gaffar

Comments

  • Options
    SogSog Member Posts: 1,023
    edited 2012-01-11
    char := <integer ascii value of symbol>
    You could have easily found this wit the help function...
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • Options
    aktharakthar Member Posts: 30
    I find on search that for generating smile symbol we need to press Alt+1 same way Alt+3 for generating heart symbol. But know the point is how to send ALT+ command in NAV code
  • Options
    SogSog Member Posts: 1,023
    the char datatype is your alt key. With the alt-key pressed the computer knows that you don't want to type 3, but the ascii char on place 128+3.
    this however is not ascii but ansi with codetable x.

    just write a report with datatype integer, setrange(number,1,255)
    add global var of type char.
    Onaftergetrecord
    var := number

    in the section display var and number: voila every symbol you can export with NAV.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • Options
    aktharakthar Member Posts: 30
    Thank you sog

    I had generated the report as you said and it has generated the ascii charactes from 1 to 255. But unfortunately i cannot able to see heart and smile symbol in the list. Do you know the exact ascii value for this and also is heart symbol belongs to ASCII value?
  • Options
    SogSog Member Posts: 1,023
    edited 2012-01-11
    Dear akthar,

    There is no heart nor smiley symbol in the ASCII dataset. ASCII is 7 bits long and contains 128 characters.
    The heart symbol and smiley symbol are available on Code Page 437
    So the exact position of the heart symbol is 130 (127 +3).
    However since this is a bankstatement you might just want to send char heart := 3 for the heart and char smiley := 1
    Because ascii table's first 33 characters are control characters that are being used as symbols in codepage 437 depending on context.
    So the smiley you see might be in the bank statement "Start of header" and the heart means "end of text".
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • Options
    aktharakthar Member Posts: 30
    Thank you sog

    Its working now thanks a lot :) (L)
  • Options
    kinekine Member Posts: 12,562
    I am wondering why they are using XML when the "control" cahracters needs to be inside... XML is used to not use such a control chars.. yeah, it looks like some old text format "encapsulated" into XML.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.