*****text21=123 lcOld = getfile() lcNew = forcepath( trim(thisform.text21.value)+"a"+"." + justext(m.lcOld), "\\istweb-devlop\error\arttachment") thisform.text24.Value=lcNew StrToFile( FileToStr( m.lcOld ), m.lcNew )&&the attachment name is 123aif i have another attachment for same text21=123
lcOld = getfile() lcNew = forcepath( trim(thisform.text21.value)+"a"+"." + justext(m.lcOld), "\\istweb-devlop\error\arttachment") thisform.text25.Value=lcNew StrToFile( FileToStr( m.lcOld ), m.lcNew )&&the attachment name is 123betc maximam 5 attachment
if i have attachment as 123a thisform.text2.value=123a &&open it via click,keypress event else thisform.text2.visible=.f. thisform.text3.visible=.f. thisform.text4.visible=.f. thisform.text5.visible=.f. thisform.text6.visible=.f. endif if i have another attachment as 123b at the same folder thisform.text3.value=123b else thisform.text3.visible=.f. thisform.text4.visible=.f. thisform.text5.visible=.f. thisform.text5.visible=.f.etc
>>SET DEFAULT TO "\\istweb-devlop\error\arttachment" >> >>DIMENSION laFiles(8) >>laFiles[1] = "pdf" >>laFiles[2] = "tif" >>laFiles[3] = "jpg" >>laFiles[4] = "gif" >>laFiles[5] = "bmp" >>laFiles[6] = "doc" >>laFiles[7] = "docx" >>laFiles[8] = "rar" >>FOR x = 1 TO ALEN(laFiles) >> m.lcFileName = allTRIM(thisform.text5.value)+"a" + "." + laFiles(x) >> thisform.text8.Value=allTRIM(thisform.text5.value)+"a" + "." + laFiles(x)&& it works >> ************************************************************************************* >> LOCATE FOR m.lcFileName = allTRIM(thisform.text5.value)+"b" + "." + laFiles(x)&¬ work >> IF FOUND() >> thisform.text9.Value=allTRIM(thisform.text5.value)+"b" + "." + laFiles(x) >> endif >> >>LOCATE FOR m.lcFileName = allTRIM(thisform.text5.value)+"c" + "." + laFiles(x)&¬ work >> IF FOUND() >> thisform.text10.Value=allTRIM(thisform.text5.value)+"c" + "." + laFiles(x) >> endif >> >>LOCATE FOR m.lcFileName = allTRIM(thisform.text5.value)+"d" + "." + laFiles(x)&¬ work >> IF FOUND() >> thisform.text11.Value=allTRIM(thisform.text5.value)+"d" + "." + laFiles(x) >> endif >> >> >> >>****************************************************************************************** >> IF FILE(m.lcFileName) >> EXIT >> ENDIF >>ENDFOR >> >> >> >> If File(m.lcFileName) >> >> Declare Long ShellExecute In "shell32.dll" ; >> long HWnd, String lpszOp, ; >> string lpszFile, String lpszParams, ; >> string lpszDir, Long nShowCmd >> >> lnResult = ShellExecute(0,'Open', m.lcFileName, 0,0,1) >> IF !(m.lnResult > 32) >> endif >> Else >> >> MESSAGEBOX("not found") >> ENDIF >> >> >>>>thanks
>m.lcFileName = allTRIM(thisform.text5.value)+"a" + "." + laFiles(x)>*Then what you are searching for? In your "locate" statement there are no table, and no table fields included.
>LOCATE FOR m.lcFileName = allTRIM(thisform.text5.value)+"b" + "." + laFiles(x)>is equivalent to LOCATE FOR .f. because m.lcFileName has different value.