** can we create the bank batch file? ** This causes some systems to crash by leaving them in a different folder (works OK on most systems) ** a bug in vfp8? if company.directbank and !empty(company.bankfile) and !inlist(left(UPPER(company.bankfile),1), 'A', 'B') mnResponse=4 do while mnResponse=4 && retry loop mlError=.f. mcCurDir=sys(5)+sys(2003) mcBankPath=UPPER(JustPath(company.bankfile)) try set defa to &mcBankPath catch mlError=.T. endtry set defa to &mcCurDir if mlError mnResponse=messagebox('The location for the direct credit file '; +ALLTRIM(company.bankfile); +' to be produced by this pay does not seem to be available.'+CRLF ; +'This may be due to a setup error or network drive no longer available or a problem accessing the folder '; +mcBankPath+'.'+CRLF ; +'(you can change the filename in Company Setup..Bank if you need to)'+CRLF+CRLF ; +'Choose Ignore if you wish to continue anyway',50,'Direct Credit File Error') if mnResponse=3 return endif else mnResponse=0 endif enddo endifThe problem arises in a small percentage of sites (from a sample of over 1000 sites running various versions of Windows, XP Home, 98 etc).
set defa to &mcBankPathfails (even though the directory being checked for is C:\ in some cases, which obviously does exist). The code manages to set the mlError status to TRUE, but doesn't successfully execute the return to the current folder using
set defa to &mcCurDirThis leaves the program running in "someotherfolder" rather than the original execution folder, and consequently if the user attempts to continue running the routine it fails when trying to access the tables which should be available in the current folder.