Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong?
Message
De
17/07/2007 18:31:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01241327
Message ID:
01241329
Vues:
39
I don't think error handling is necessary. You can use type() or vartype() first, to check whether _screen.Forms[lnCount] exists.

Error handling is more likely to be required to handle anything OUTSIDE your application, such as access to files - where you can't tell in advance what the situation is going to be (e.g., whether a file exists, or whether you can actually access it).

>Hi everybody,
>
>Ok, I want to finish this problem today.
>
>This code:
>
>
> FOR lnCount = _screen.FormCount TO 1 STEP - 1
>      loForm = _screen.Forms[lnCount]
>      IF PEMSTATUS(loForm, 'QueryUnload', 5)
>         IF NOT loForm.QueryUnload()
>            * We can not close the form
>            llExit = .f.
>            EXIT
>         ELSE
>            loForm.release()
>         endif
>      ELSE
>          IF PEMSTATUS(loForm, 'Release', 5)
>            loForm.Release()
>          ENDIF
>      ENDIF
>   NEXT
>
>Gives form is not an object on loForm = _screen.Forms[lnCount] line.
>
>What I'm doing wrong today? I can put it in try/catch, but how can I exit gracefully?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform