hi,
thank you for reply,
i try as under , but i got error message Variable "lcFileName" is not found
IF !EOF()
thisform.text1.value=thisform.text1.value+1
thisform.text2.value=nam
local lcImageFile
lcImageFile = "images\"+alltrim(str(thisform.text1.value)) +(".jpg")+(".GIF")
if file(lcImageFile)
ThisForm.Image1.Picture = lcImageFile
SKIP
else
MessageBox("The picture doesn't exist - filename: " + lcFileName)
skip -1
endif
ENDIF
>>Hi,
>>
>>thank you for reply, i don't know what you mean?
>
>Tore means that you should use the debugger (or any other debugging technique, like showing information with a WAIT command or with a MessageBox()), to see what is the name of the file you are trying to fetch. Then, you can see if the file exists, or if it even has a correct name.
>
>You should change your code, to make debugging easier. Specifically, you should separate the filename to a variable, like this:
>
>
>local lcImageFile
>lcImageFile = "images\"+alltrim(str(thisform.text1.value))+(".GIF") +(".jpg")
>MessageBox("The filename is: " + lcImageFile)
>Thisform.Image1.Picture = lcImageFile
>
>
>If you separate the filename into a variable, as in my code above, it is easier to debug (debug means to find errors).
>
>The MessageBox() command was inserted to show if the file name is correct. Once it works, you can take MessageBox() out; instead, you can add other commands, for example, to test whether the file, specified by the user, exists:
>
>
>if file(lcImageFile)
> ThisForm.Image1.Picture = lcImageFile
>else
> MessageBox("The picture doesn't exist - filename: " + lcFileName)
>endif
>