File text and NF

DurandDurand Member Posts: 61
edited 2001-11-20 in Navision Financials
Hello, How can one create a file text in the root of the hard disk, then he transferred by the data of Navision (example, code and name of the customers) at first time? Next, How can one read it sequential of Navision.? And the end, then how can one destroy it? Thank you for your invaluable help, Benoît.

Comments

  • LdLLdL Member Posts: 4
    Use C/Side Reference Guide - Letter 'F'
    To create the file :
    Use f.CREATE(FileName) and f.TEXTMODE(TRUE)
    To transfer Navision data use a report and
    in the Body OnPreSection add the necessary code to write your fields to the txt file (f.WRITE(Value))To read the file : f.READ(Variable)
    To erase the file : ERASE(Name)
    LdL
  • DurandDurand Member Posts: 61
    Thank you for the help, but I have another problem. I don't known to read the file text.Is it necessary to use a repetitive structure. But which is the syntax with the end of the file ( EOF). Should one use a data groups, if yes, how defines it one?
    Thank, you (sorry for my english...), Benoît.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Here is an example:
    TextFile : File
    TextLine : Text[250]

    TextFile.TEXTMODE := TRUE;
    TextFile.OPEN('c:\file.txt');
    WHILE TextFile.POS <> TextFile.LEN DO BEGIN
    TextFile.READ(TextLine);
    END;
    TextFile.CLOSE;
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Stefan_LimpertStefan_Limpert Member Posts: 30
    Hi Benoit,
    if the Text-Row in your File larger than 250 Bytes. You can also use a Dataport for an easier Import or Export of Data.

    Regards Stefan
Sign In or Register to comment.