Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unfinished business with a class?
Message
De
31/07/2001 15:04:40
 
 
À
31/07/2001 07:24:30
Denis Filer
University of Oxford
Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00537679
Message ID:
00537943
Vues:
11
>At the core of my database application is a Form+Grid class. Launched with this browse-screen grid class is a toolbar and a grid-specific menu with tools that relate to the active module. It all looks a bit like an Excel worksheet. Occasionally, when the grid form is closed and my main database menu returns, the program gives the error 'DBGRID is not an object' - where DBGRID is the name of the said form+grid class. The debugger shows the program is trying to execute a bit of code that refers to DBGRID - that was in fact carried out whilst the grid was open, for example, something done by one of my toolbar buttons or my grid menu tools options. Almost as if it didn't properly leave the offending function. I wonder if it's a read events issue? Any ideas? It's driving me nuts trying trace it!

Insert a validation code before you actually execute the dbgrid code as such:
IF VARTYPE(dbgrid) = 'O' AND !ISNULL(dbgrid) 
   *-- the object is valid
   *-- The code that causes the error is run here and
   *-- should run without problem. Otherwise
   *-- check your object name reference: form+grid if correct.
ELSE
   debug            && start the debugger
   suspend          && suspend the application
   *-- go to the debugger and investigate as to whether dbgrid is
   *-- actually form+grid; etc.
ENDIF
ramil
~~ learning to stand still
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform