Re: Reindex appears to be packing tables!

From: Debbie (
Date: 11/04/04

Date: Thu, 4 Nov 2004 09:41:41 -0500

Before the IF...ELSE...ENDIF, I convert the passed parameter to lowercase
(ie. lctable = LOWER(lctable). But my point is that the statement isn't
faling because I added a messagebox to the method to show me which part I
was falling into! The PackTable method is returning the correct value, but
it doesn't seem to make any difference - that's the bit I'm having trouble

This mailbox protected from junk email by MailFrontier Desktop
from MailFrontier, Inc.
"Jeroen van Kalken" <> wrote in message
> On Wed, 3 Nov 2004 12:06:19 -0500, "Debbie" <>
> wrote:
> Since adir() returns filenames in uppercase, your IF statement will
> probably fail. (see below)
>>I didn't list all of my code in the message I posted, but I do test to see
>>if the file can be opened exclusively.  If it can't, I let the user know
>>which table and then move on to the next one listed in the array.  I'm not
>>getting any errors, it's just packing all the tables irrespective of 
>>I said it was okay to do so or not!
>>As for the PackTable method, it's just a simple IF...ELSE...ENDIF, ie:
>>IF lctable = "table1.dbf" OR lctable = "table2.dbf" OR "table3.dbf" && Etc
> change it to:
> IF inlist(lower(lcTable),"table1.dbf", "table2.dbf", "table3.dbf",...)
>>        RETURN .F.
>>        RETURN .T.
>>Do you have any other suggestions?  Thanks!
> You could even shorten it to:
> proc PackTable
> Return inlist((lower(lcTable),"table1.dbf", "table2.dbf",
> "table3.dbf",...)
>>Debbie :o)
>>"Craig Berntson" <> wrote in message
>>> You didn't show the code in the PackTable method. However, if you can't
>>> open the table EXCLUSIVE, you'll get an error. In addition, REINDEX is 
>>> not
>>> reliable. The key information is stored in the header of the CDX. If 
>>> that
>>> gets corrupt, REINDEX will either cause an error or create a corrupt
>>> index.
>>> -- 
>>> Craig Berntson
>>> MCSD, Visual FoxPro MVP
>>> Salt Lake City Fox User Group
>>> "Debbie" <> wrote in message
>>>>I have a reindex program that uses the ADIR() function to gather the 
>>>>of all my tables and then reindex them.  Before reindexing each table, I
>>>>pass the table name to a method which tells me whether or not it is one
>>>>that can be packed at this time (it returns .T. if the table can be
>>>>packed, and .F. if it can't).  My problem is that, regardless of what 
>>>>method returns, all tables get packed!  I added a messagebox to tell me 
>>>>I was falling into the correct part of my code, and I was.
>>>> llpack = THISFORMSET.PackTable(lctable)
>>>> USE (lctable) EXCL ALIAS lctable
>>>> IF llpack
>>>>        PACK
>>>>        REINDEX
>>>> ELSE
>>>>        =MESSAGEBOX("Not packing.",0)  && Test
>>>>        REINDEX
>>>> ENDIF
>>>> USE IN lctable
>>>> Maybe I'm missing something silly, but I'd appreciate it if anyone out
>>>> there had some suggestions!  Thanks in advance.
>>>> Debbie