New Line Char

mickukmickuk Member Posts: 47
edited 2005-04-08 in Navision Financials
Hi all,

Im just building a section of code that generates a file that is read by another system, however im not sure quite how the syntax of the write statement works. Im used VB where you can specify and end of line char (charrige return) so that when you write a line to a file it moves down to the next.
SiteFile.WRITE(item."groupname" + 'testtext');

As you can see its nothing complex that im trying to do but i find this development environment a nightmare!! What im looking for is to insert a end of line character after "testtext". Any help would be appreciated as the C/AL reference lib is VERY clear :P

Cheers in advance

Mick

Comments

  • jmjm Member Posts: 156
    Hi,

    try SiteFile.TEXTMODE(TRUE) before you open SiteFile.
    this should do charrige return and new line.

    Read the C/SSIDE Reference Guide (=Online Help) for:
    OPEN, WRITE and TEXTMODE

    br
    Josef Metz
    br
    Josef Metz
  • mickukmickuk Member Posts: 47
    Thanks for your response, i'm investigating what you suggested at the moment. Guess i just need to read the C/AL ref more and more, been through it a few times already #-o
  • jhoekjhoek Member Posts: 216
    I usually create a function that returns an ASCII 13 followed by an ASCII 10. I typically call the function "CrLf", call the return value "Result" of type Text2. It contains the following code:
    Result[1] := 13;
    Result[2] := 10;
    

    The function can then be used to do the following:
    MyFile.WRITE('Foo' + CrLf + 'Baz');
    
    Kind regards,

    Jan Hoek
    Product Developer
    Mprise Products B.V.
  • mickukmickuk Member Posts: 47
    Thanks again for the information, you have been very helpful. The text mode function worked a treat....I can see where you are coming from though jhoek i didn't really thing about using a char variable and setting it to the carrige return char.

    Good to know for future reference though. Fridays and mondays are never good to dive into a problem when you know your going to get distuirbed :P

    Mick
Sign In or Register to comment.