Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using the clipboard
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01453989
Message ID:
01455577
Vues:
63
this is the only part of the code where i made changes. a couple or superfelous now as i was testing different things. i originally had the copy file to command on its own but put it into the variable in case that made a difference. how would i remove chr(0)?
 * Get each file name
	FOR lnFile = 0 TO lnFileCount-1
		lnLen = DragQueryFile(lnHdrop, lnFile, @lcBuffer, lnSize  )
		? lnFile+1, LEFT(lcBuffer, lnLen)
		
		IF MESSAGEBOX("Do you want to save file " + lcbuffer + "?",36,"Save File") = 6
			* yes
			
			mfilefrom = ALLTRIM(lcbuffer)
			mcallnum1 = "C:\kernel\"  &&SYS(5) + CURDIR() + "a\"
			*SUBSTR(lcBuffer,RAT("\",lcBuffer) + 1,50)
			
			mfilenameandloc = mcallnum1 + ALLTRIM(SUBSTR(mfilefrom,RAT("\",mfilefrom) + 1,50))
			*mfilenameandloc = "c:\kernel\"
			? "     " 
			? mfilefrom
			? FILE(mfilefrom)
			? SUBSTR(mfilefrom,RAT("\",mfilefrom) + 1,50)
			? mfilenameandloc
			mruncode = "COPY FILE " + mfilefrom  + " TO " + mfilenameandloc
			? mruncode
			&mruncode
		ELSE
			* no
		ENDIF
	ENDFOR
~M

>It sounds like you got CHR(0) at the end of the file name. I run my code again and I don't see any extra characters at the file names. Did you modify code in any way that could cause the problem?
>
>>thanks, am most of the way there, hopefully you can clear something up for me. I've used your code and gotten the list of files on the clipboard and have the file name, but there are spaces at the end of the name that i cannot get rid of and it is causing my copy file to fail. code is here. I get the file name and it is in a variable but no matter what way i trim it it is always "C:\KERNEL\FILE1.bmp ". the spaces at the end are causing the problem I think but I can't remove them, any ideas?
>>~M
>>
>>>Check http://www.berezniker.com/search/apachesolr_search/clipboard
Go raibh maith agat

~M
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform