Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code need fix
Message
De
04/06/2009 02:01:49
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01403350
Message ID:
01403609
Vues:
46
thank you for reply,

i get attachment form drive c,d...etc via text24 get dir and cahnage the name of attachment via text1 at myform as
*****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 123a
if 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 123b
etc maximam 5 attachment
**************************************************************************
i need to open or call this attachment to another form when i insert idnumber(text1)=123
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

thanks

>>hi all,
>>
>>i need help to fix this code below
>>
>>
>>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)&&not 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)&&not 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)&&not 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
>
>What are you doing?
>* you assign value to variable m.lcFileName:
>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.
>Your:
>LOCATE FOR  m.lcFileName = allTRIM(thisform.text5.value)+"b" + "." + laFiles(x) 
>is equivalent to LOCATE FOR .f. because m.lcFileName has different value.
>Sure you will not locate anything.
>
>Good Luck
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform