Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


FileMath UDFs and fmGetFileObject

Keywords: 	 fmGetFileObject

Question:

Input.txt is an input file.

Output.txt is an output file.

I want to call just the fmRemoveDups UDF from your FileMathUDFs, which I've placed in an external file, fmDedupe.wbt.

I've tried this:

Call("fmDedupe.wbt", "")
fmRemoveDups("input.txt", "output.txt")
But I know this isn't right and it generates a Param1 error ("...not a FileObject").

Do I have to do a FileOpen on both the input and output files prior to using fmRemoveDups?

Can you please correct my syntax? Thanks

Answer:

Well. Hmmm It's going to be something like...
Call("fmDedupe.wbt", "") ;??????

inny=fmGetFileObject("input.txt",1)
outy=fmGetFileObject("output.txt",0)
fmRemoveDups(inny,outy)
However I see you can a file fmDdupe.wbt and it is somewhat unclear what that file is.

If it is simply all the UDFs MINUS the examples from the web board posting then that would be correct.

If the exampels were left in, or if not all the UDF's were included, then there may be *problems*

Personally I like to add the UDFs to my scripts - inline -

If you're not going to load up all the UDFs in that article, then the essential UDFs you'll need for this operation are:

fmGetFileObject
fmVerifyObject
fmRemoveDups
fmSortFile
and then to run it (you need to do a fmGetFileObject on both the inny and outy):
inny=fmGetFileObject("c:\temp\filein.txt",1)
outy=fmGetFileObject("c:\temp\fileout.txt",0)
fmRemoveDups(inny,outy) 

Article ID:   W15333