Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disabling indexes for a moment
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00543126
Message ID:
00543137
Vues:
34
This message has been marked as the solution to the initial question of the thread.
Here's a simple program I'm using in cases like this. Don't forget to remove space after << and before >>.
PARAMETERS pcAlias, pcPrgName
SET TALK OFF
*-* Indexes
cPrgName = IIF(EMPTY(pcPrgName), "zRecrInd", pcPrgName)
cPrgName = IIF("." $ cPrgName , cPrgName , cPrgName + ".prg")
SELECT (pcAlias)	

* Process all indexes
SET TEXT ON
SET TEXT TO (cPrgName)

\SET TALK OFF
\* DBF=<< DBF() >>
\SET TALK NOWIND
\SET TALK ON
\
\? "Indexing:", DBF()
\?


FOR i = 1 TO TAGCOUNT()
	m.Tag = TAG(I)
	m.Key = KEY(i)
	m.For = For(i)
	
	\? "Index << i >> << m.tag >> "  +  TIME()
	IF EMPTY(m.For)
		\INDEX ON << m.Key >> TAG << m.Tag >>
	ELSE	
		\INDEX ON << m.Key >> TAG << m.Tag >> FOR << m.For >>
	ENDIF	

ENDFOR

SET TEXT TO 
SET TEXT OFF

RETURN
>Hi everybody,
>
>I have a file with lots of indexes. I have to append couple of files into this file. I'm using APPEND FROM command to append. This operation is very slow due to the indexes. Is there a simple way of "disabling" indexes for a moment?
>
>I'm thinking about renaming cdx temporary, do append operation, rename it back and do reindex. But it sounds like klugy approach, besides, file will give an error in attempt to open it.
>
>Can you suggest something here? It's for VFP6.0.
>
>Thanks in advance.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform