I need to read a directory and to put all filenames in this directory in a Navision-table. Can anyone help me?
If you do not know anything of the potential filenames then use the SHELL command to execute a DOS DIR command and send the output to a file (e.g. “dir c:\target > c:\temp\dirlist.txt”) then open the resulting file with Navision and read it in line by line extracting the filename. If you do know something about the filenames that might be there (e.g. they begin with the word DATA followed by a number with the filetype suffix .TXT) then you could set up a loop using the EXISTS command to check each possible filename in turn. Those are the solutions that immediately spring to mind.
Use the Navision Table File MyPath:=‘C:\Temp’; //Set the Path Setrange(Path,MyPath); Setrange(IsAFile,True); // Remember Filtering is Case sensitive // If you want to filter only txt files Setfilter(Name,’@*.txt’); Then the table will contain all txt files in the Directory Path Mr David Cox MindSource (UK) Limited Navision Solutions Partner Email: firstname.lastname@example.org Web: www.mindsource.co.uk Edited by - David Cox on 7/18/00 12:17:31 PM
Thanks a lot to all answers!!!
you can do use my form on http://www.hermida.com/navision/3rdparty.htm