Thanks Bill & Peter, However, all of the entries in the dbf end with a backslash. This makes no sense. If I open the table manually in MapInfo, close it, then use fileexits() in the MapBasic window, it returns TRUE. If I restart the program, the data for the folder I just tested will process correctly but the next will not.
Dan -----Original Message----- From: Bill Thoen [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 11:37 AM To: Dan Phillips Subject: Re: MI-L Problem with Fileexists() (I think) Are you sure you terminate your paths with a backslash? If workp doesn't end in a '\' then workp+"AllData.tab" isn't going to exist. On Mon, 28 Mar 2005, Dan Phillips wrote: > I'm trying to process TIGER data for every county in the US and have run > into a problem with the fileexists() function. My MapBasic program is > looping through each county by reading a path name from a dbf and adding a > table name (e.g. 'E:\tiger2004fe\KY\21111\mapinfo\AllData.Tab'). Everything > works fine until the loop reaches the second folder for Nevada. I know the > folder and table exist yet fileexists() returns false. > > The basic code from the program is below: > > ************************ > Open Table "E:\tiger2004fe\pathlist.TAB" Interactive > > fetch first from pathlist > > do while not eot(pathlist) > > workp=pathlist.path > > print workp > print done > print FileExists(workp+"AllData.tab") > > If not FileExists(workp+"AllData.tab") then > goto skiprec > End If > > open table workp+"AllData.tab" > > '***************** > 'Process data here > '***************** > > skiprec: > > fetch next from pathlist > > loop > ************************ > > Has anyone else experienced anything similar? > > BTW, I'm using MapInfo & MapBasic <gulp> 4.5 w/XP Pro. > > Thank you, > > Dan Phillips > > > --------------------------------------------------------------------- > List hosting provided by Directions Magazine | www.directionsmag.com | > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Message number: 15818 > --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 15820
