Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check for Exclusive Open?
Message
De
14/01/2003 08:55:39
 
 
À
13/01/2003 14:49:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00741115
Message ID:
00741382
Vues:
28
>The best method is to do what Garret has suggested. You can make a function that does this for you. Something like this:
>
>
>lcOldError = on("error")
>llOpenError = .f.
>on error llOpenError = .t.
>use table1.dbf exclusive in 0
>on error &lcOldError
>if !llOpenError
>   * we opened the file exclusively
>else
>   * could not exclusively open file
>endif
>


Or, also as Garret suggested, for VFP8, something along these lines:
TRY 
   USE HOME(2) + "data\customer" IN 0 EXCLUSIVE
CATCH TO OERR
   MESSAGEBOX(TRANSFORM(OERR.MESSAGE) + CHR(13) + ;
      "LINE #:" + TRANSFORM(OERR.LINENO) + CHR(13) + ;
      "LINE:" + TRANSFORM(OERR.LINECONTENTS), ;
      16, "ERROR IN " + TRANSFORM(OERR.PROCEDURE))
FINALLY
ENDTRY


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform