Navision File Functions
Navision File Functions is a simple and direct implementation of the Delphi functions FindFirst, FindNext and FindClose.
Created this DLL to import (dataport) multiple files in one run.
See NavFileFn - Example of use.htm for more information.
http://www.mibuso.com/dlinfo.asp?FileID=531
Discuss this download here.
Comments
Peter
To be honest, when making this I didn't realize there was an Navision function available for this:
From the forum Navision Attain, "File searches in Navision"
Extracted from the example as stated by Luc van Dyck, does exactly the same thing:
recFile.SETRANGE(Path,'c:\temp\');
recFile.SETRANGE("Is a file",TRUE);
recFile.SETFILTER(Name, '@*.TXT');
IF recFile.FIND('-') THEN BEGIN
REPEAT
MESSAGE(recFile.Name);
UNTIL recFile.NEXT = 0;
END
ELSE
MESSAGE('no file found');
Luc, can you pull this file form the download list, because it is useless
http://home.casema.nl/mvandermeij
There is a sample with the wshell available also.
Still want to thank Peter for his remark on the need of this tool, because at the customer where we use it they have a standard desktop load and every extra DLL is one too many (not mentioning the problems of getting it installed on all Navision clients).
As said on my webpage, if anyone does really needs a (system) function not available in Navision but available in other programming languages mail it to me and I will give it a go...
http://home.casema.nl/mvandermeij
Navision File Functions is a simple and direct implementation of the Delphi functions FindFirst, FindNext and FindClose.
Created this DLL to import (dataport) multiple files in one run.
See NavFileFn - Example of use.htm for more information.
Version 1.1:
Added the function FindSetDirectory, which can be used to browse for a directory and returns the directory name so you can use it in a variable or setup record.
Sample:
CREATE(lAutoFileFunctions);
CLEAR(lVarResult);
LAutoFileFunctions.FindSetDirectory( lVarResult );
Rec.”Import Directory” := FORMAT( lVarResult);
CLEAR(LautoFileFunctions );
The previous functions FindFirstFile, FindNextFile and FindCloseFile are still in there although you can also use the system record FILE (see reactions on the previous version).
http://www.mibuso.com/dlinfo.asp?FileID=531
Discuss this download here.
http://home.casema.nl/mvandermeij