Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to verify if file exist an place the path on my curs
Message
De
07/06/2013 04:37:34
 
 
À
07/06/2013 04:26:12
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01575803
Message ID:
01575817
Vues:
30
LaDummy is an array which hold the value returned by adir. You can forget that it's there, but you need to put it in.

No update means that the file isn't there, you must check!

This patch will accept any file type.
Local lcFile As String, ;
   lcImageName As String, ;
   lcImagePath As String
Select ImgMarca && My cursor name
m.lcImagePath = ([\\127.0.0.1\imagens\])
Scan
   m.lcImageName = Alltrim(ImgMarca.campo)
   m.lcFile = m.lcImagePath + m.lcImageName + [.*]
   If Adir(laDummy, m.lcFile) > 1
      Replace u_imgMarca With m.lcImagePath + laDummy(1, 1)
   Else
      Replace u_imgMarca With []
   Endif
Endscan
>Hello Tore
>
>Thanks for your reply, but i test it and the field u_imgMarca of my cursor don´t update with \\127.0.0.1\imagens\vinhos.jpg, why ?
>i i use a messagebox(m.lcFile) , then they return to me : \\127.0.0.1\imagens\vinhos.jpg
>Also, laDummy is what ?
>also, how to use wildcard on your code to include any extension, like you suggest ?
>I don´t understand laDummy ??
>
>
>Local lcFile As String, ;
> lcImageName As String, ;
> lcImagePath As String
>Select ImgMarca && My cursor name
>m.lcImagePath = ([\\127.0.0.1\imagens\])
>Scan
> m.lcImageName = Alltrim(ImgMarca.campo) + [.jpg]
> m.lcFile = m.lcImagePath + Forceext(m.lcImageName, [jpg])
> If Adir(laDummy, m.lcFile) = 1
> Replace u_imgMarca With m.lcFile
> Else
> Replace u_imgMarca With []
> Endif
>Endscan
>
>
>I hope you can help me
>
>Many thanks
>Luis Santos
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform