Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HELP!!! This code works in debug but not in program.
Message
De
16/09/1998 15:55:15
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
HELP!!! This code works in debug but not in program.
Divers
Thread ID:
00137460
Message ID:
00137460
Vues:
72
All you guru's out there:

The following code has two programmers completely stumped. The code fails to USE the indicated database right before the suspend in the following code snippet. It loops through this code 4 times and fails each time on the use. Then the select fails because it can't find the table.

One other thing, the method's error handler picks up an error 'Structural index not found'. These files are downloaded from a vendor's ftp site and have no index files associated with them. If I use the same macro expansion from the code window, it runs just fine.

However, if I place a suspend in the code before the &lcCmd macro, and run it from there, each table is used, and the the indexes created.


What's going on??
FOR lnIndex2 = 1 TO ALEN(aCursors,1)
  lcCurName = ALLTRIM(aCursors(lnIndex2,2))
  lcExt = ALLTRIM(UPPER(SUBSTR(aCursors(lnIndex2,3),                        RAT('.',aCursors(lnIndex2,3))+1)))

  DO CASE
     CASE lcExt == 'DBF'
	&tcCnt..lblStatus.Caption = 'Creating data table from ' +                   ALLTRIM((aCursors(lnIndex2,3)))
	lcFile = UPPER(thisform.cSourceDir +                                    ALLTRIM(aCursors(lnIndex2,3)))
	lcVar = ALLTRIM(aCursors(lnIndex2,5))
	lcTag = ALLTRIM(aCursors(lnIndex2,4))
	lcCmd = 'USE '  + lcFile  + ' IN 0 ALIAS  ' + lcCurName
	&lcCmd

	SELECT (lcCurName)
	lcIndexCommand = 'INDEX ON ' + lcVar + ' TAG ' + lcTag
	&lcIndexCommand
     ENDCASE		
ENDFOR
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform