Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LNKFILES.DLL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00160686
Message ID:
00162225
Vues:
38
Hi Marcel,

You're welcome.

Just because the link file exists doesn't necessarily mean that the target file does. In your code sample, you assume that because the FILE() function returns .F. that it's a long file name, and call the ShortToLong() function I wrote. However, if that function doesn't find the file, it returns an empty string, which you don't check for. While I don't have too much experience with General fields, I'd suggest the following modification to your code:
llIsShort = ("~" $ lcfile)
IF llIsShort
  lclongname = ShortToLong(lcfile)
ELSE
  lclongname = lcfile
ENDIF
IF NOT EMPTY(lclongname) AND FILE(lclongname)
  APPEND GENERAL GenField FILE (lclongname) LINK
  MODIFY GENERAL GenField
ELSE
  = MESSAGEBOX("The file " + lcfile + " does not exist!", 64, "File Not Found")
ENDIF
Naturally, the field "GenField" referenced above should be modified to reflect the field name in the table you're working with. If you get the messagebox, you'll know that the file doesn't exist.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform