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 02:16:52
 
 
À
06/06/2013 18:31:45
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:
01575812
Vues:
41
I strongly recommend that you include the file extension (.jpg) in the field, why limit yourself to .jpg? png is used more and more, jpg may disappear over time.
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
>Hello comunity
>
>I have write this code above, that is based on a cursor, also on my local computer on disk C: i create a folder "Imagens" where i put in my image "Vinhos.jpg", also i don´t understand why the field ImgMarca.u_imgMarca keep the following path : \\127.0.0.1\Imagens\vinhos.jpg.
>
>
>select ImgMarca && My cursor name
>scan
>ImagePath = ('\\127.0.0.1\imagens\')
>ImageName = alltrim(ImgMarca.campo)+'.jpg'
>
>
>if NOT empty(sys(2000,"ImagePath+ImageName"))
>   replace ImgMarca.u_imgMarca with alltrim(ImagePath+ImageName) 
>else
>   replace ImgMarca.u_imgMarca with ''
>endif
>endscan
>
>
>Someone could give me an Help, because i need to solve this problem quickly.
>
>Many thanks
>Luis Santos
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform