Evaluating filenames in a Windows directory

AlexanderAlexander Member Posts: 2
edited 2001-04-25 in Navision Financials
Please can so. help me with this request?
I want to import text files into Navision 2.60.
It should be determined by the initial letters of the filename which out of three dataports should be applied to read in the text file.
Does anyone know of a module which can open a Windows directory and read the filenames of all files enclosed in this directory, so it is possible for Navision to derivate the right dataport to be run with the filename?

Another question would be if this is also possible automatically. Can it be automatically detected when another text file to be imported has been added to the directory?

Thank you.

Comments

  • Dennis_DecoeneDennis_Decoene Member Posts: 123
    There are two virtual tables, 2000000020 and 2000000022, which you can declare as a variable. The allow you to read the entire contents of the hard drive. You can use them as you would with any other table.

    Experiment with them. You'll soon find what you need

    Dennis Decoene
    Navision Software Engineer
    http://www.microcomputing.be
  • Lars_WestmanLars_Westman Member Posts: 116
    Just remember that when You create Your "dispatcher", You'll have to redirect Your pointer in the File Table and set the filter again each time You search for any new files. If You don't do this You won't find any new files.

    Example:
    File.SETRANGE("Is a file",TRUE);
    REPEAT
    --File.SETRANGE(Path,'c:\');
    --IF File.FIND('-') THEN BEGIN END;
    --File.SETRANGE(Path,'c:\where You want to look for files');
    --IF File.FIND('-') THEN
    ----REPEAT
    //Your code that does something with each file
    ----UNTIL File.NEXT = 0;
    UNTIL You're finished and want to go home

    //Lars Westman

    [This message has been edited by laweume (edited 24-04-2001).]
Sign In or Register to comment.