Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening a table without showing an error
Message
De
01/07/2000 17:39:21
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00386523
Message ID:
00387438
Vues:
17
>Ahh... That seems to simple now that I look at it. Thanks for being my replacement brain today. :)
>
>Michelle
>
>
>>Have a separate function to open the table (OpenTable). This function is something like this:
>>
>>
>>Function OpenTable
>>LParameters tcTableName
>>Local lcOnError, llError
>>
>>llError=.F.
>>lcOnError=On("Error")
>>On Error llError=.T.
>>Use (tcTableName)
>>On Error &lcOnError
>>
>>Return Not (llError)
>>
>>This is off the top of my head so will need playing with.

If you need to check what kind of error you got, you can rite your own erro r handler in the same .PRG file.

*myprog.prg
FUNCTION WhatEver
LOCAL cOldError
cOldError = ON("ERROR")
ON ERROR DO ErrorHandler WITH ERROR(),LINENO(),MESSAGE()
* your code here
ON ERROR &cOldError
RETURN

FUNCTION ErrorHandler
LPARAMETERS nError, nLine, cMessage
* do what ever you need to do here based on the error


FUNCTION OthersAsNeeded

*end of myprog.prg


You can have as many functions you need to have "local" to your own .PRG as part of the .PRG. They will be available any time tha "main" function of your .PRG is called.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform