Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check to see if a file is open
Message
De
09/05/2007 16:36:10
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01223969
Message ID:
01223986
Vues:
14
This message has been marked as a message which has helped to the initial question of the thread.
>In this particular app, I am stuck with VFP 6.0 due to the operating system requirement. I don't think that VFP 6.0 has Try/Catch, does it? I cannot upgrade the particular machine that this program will run on until I also upgrade the DOS Hand-Held Barcode Scanners to Windows Scanners.

Well, the title says "VFP 9".

In VFP 6, you would use ON ERROR, more or less like this:
local llError
on error llError = .T.

* The following is the line (or lines) that could cause an error
use MyTable

on error && See note (1)
if llError
  MessageBox("The file could not be opened; please try again later.")
  * Or do some more detailed analysis, e.g. with aerror()
else
  * Go ahead, and do whatever you would with the table
endif
Note 1: This part gets a little more complicated if you already have a previous ON ERROR, which you must restore in this case.
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