Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to trap when an index is on a second table
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How to trap when an index is on a second table
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01033041
Message ID:
01033041
Vues:
88
Have a moment of densness today.

* Goal is to trap for the following situation
* two files involved
* testabc.dbf with a chr field abc of 10 spaces
* testdef.dbf with a chr field def of 10 spaces
* if both tables are opened at the same time
* and an index is created on the first table of index on testabc.abc+testdef.def tag test
* (this is a practice I would never use indexes with other tables involved)
*
* If table testdef is not open when you open table testabc - then an error will happen.
* a message that "alias testdef does not exist"
*
* When this happens I can not get an error number for it - errhand does not even fire.
*
* table testabc will go ahead an open
* I tried wrapping in try catch
* I am dense today - on how to trap for this
*
*
* goal is a way to trap for this situation and inform the user that there is an index
* involved that includes an additional table
*
*


ON ERROR DO errhand WITH ;
ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )


use testabc in 0



ON ERROR && restore system error handler


PROCEDURE errhand
PARAMETER merror, mess, mess1, mprog, mlineno
CLEAR
? 'Error number: ' + LTRIM(STR(merror))
? 'Error message: ' + mess
? 'Line of code with error: ' + mess1
? 'Line number of error: ' + LTRIM(STR(mlineno))
? 'Program with error: ' + mprog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform