tab in a file

ricky76ricky76 Member Posts: 204
I am creating a file from Navision with just one line of data. However between a couple of the variables i export to the text filed i want to have a tab between them. Can anyone show me an example of how to do this? Any help would be greatly appreciated.

Comments

  • krikikriki Member, Moderator Posts: 9,110
    global variable txtTab : Text10;
    txtTab := 'x';
    txtTab[1] := 9;
    
    
    
    filTheFile.WRITE('Some text' + txtTab + 'and this comes after the TAB');
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • ricky76ricky76 Member Posts: 204
    Many thanks
  • ara3nara3n Member Posts: 9,256
    Is there a reason why you have the following line?

    txtTab := 'x';
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • WaldoWaldo Member Posts: 3,412
    Probably to have a [1]st char? Never used it this way either.

    I always use char:
    chrTab := 9;
    filTheFile.WRITE('Some text' + FORMAT(chrTab) + 'and this comes after the TAB');
    

    Some search results:
    - http://www.mibuso.com/forum/viewtopic.php?t=3980
    - http://www.mibuso.com/forum/viewtopic.php?t=4556

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • krikikriki Member, Moderator Posts: 9,110
    ara3n wrote:
    Is there a reason why you have the following line?

    txtTab := 'x';
    I am not sure if Navision uses 0-terminated strings internally or another way.
    So just to be sure I initialize the string.
    I don't know if it is needed, but I do it anyway to be sure it will work fine.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • ara3nara3n Member Posts: 9,256
    It works without it. Using a string instead of char makes the code smaller, you don't have to write format everywhere.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • WaldoWaldo Member Posts: 3,412
    ara3n wrote:
    It works without it. Using a string instead of char makes the code smaller, you don't have to write format everywhere.

    Where are the days we were looking at the number of lines ... now we're even looking at the number of characters... . :mrgreen:

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • krikikriki Member, Moderator Posts: 9,110
    Waldo wrote:
    ara3n wrote:
    It works without it. Using a string instead of char makes the code smaller, you don't have to write format everywhere.

    Where are the days we were looking at the number of lines ... now we're even looking at the number of characters... . :mrgreen:
    Well, there is a limit on how many characters we can cram into 1 line. :wink:
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.