View Single Post
Old 4th June 2008, 09:47
NPRao's Avatar
NPRao NPRao is offline
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,084
NPRao will become famous soon enough
Baan: Baan 4-5,5.2(Reger),LN-6.1,Infor LN-10.x - DB: Oracle,MS-SQL - OS: HPUX, Linux, Windows

Few things I noticed is the use of shell() commands. You are hard-coding the OS commands into Baan code, instead of using the available tools functions. Refer to the Programmer's manual - Directory and file operations synopsis
You can replace all the cp, mv, rm commands by file.cp(), and file.rm() which are platform independent.
Quote: = "ls " & strip$(path.input.o) &" > " & strip$(path.log.o) & "/CSCN_ASN_files"
ret = shell(, 0)
Refer to the thread for the sample code to read the files in the directory - reading Ascii file
The script does need some code clean up to use arrays, coding standards etc.
if not then
	err.hap = tcyesno.yes
The file pointer should be closed before the 1st return. The other statement will fail in case of duplicate records, missing db.skip.dupl option.
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao

Last edited by NPRao : 5th June 2008 at 22:24.
Reply With Quote