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
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