Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Occasional errors with DataToClip
Message
 
À
07/07/2009 15:27:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01410680
Message ID:
01410817
Vues:
50
This message has been marked as the solution to the initial question of the thread.
Hi Jim,

Here's my code
*========================================================================================
* Replacement for the _VFP.DataToClip method
*========================================================================================
Function DataToClip(tcAlias)

	Local lcResult, lcRecord, lnSelect, lnField, lcValue, lnRecCnt
	
	lnSelect = Select()
	lcResult = ""

	For lnField=1 to Fcount()
		If m.lnField > 1
			lcResult = m.lcResult + Chr(9)
		EndIf 
		lcResult = m.lcResult + Proper(Field(m.lnField))
	EndFor
	lcResult = m.lcResult + Chr(13)+Chr(10)

	lnRecCnt = 0
	Select (m.tcAlias)
	Scan
		lcRecord = ""
		For lnField=1 to Fcount()
			If m.lnField > 1
				lcRecord = m.lcRecord + Chr(9)
			EndIf 
			DO case
			Case Type(Field(m.lnField)) == "M"
				If Empty(Evaluate(Field(m.lnField)))
					lcValue = "memo"
				Else
					lcValue = "Memo"
				EndIf 
			Otherwise 
				lcValue = Rtrim(Transform(Evaluate(Field(m.lnField))))
			EndCase 
			lcRecord = m.lcRecord + m.lcValue
		EndFor
		lcResult = m.lcResult + m.lcRecord + Chr(13)+Chr(10)
		lnRecCnt = m.lnRecCnt + 1
	EndScan 
	
	_Cliptext = m.lcResult
	
	Select (m.lnSelect)

Return m.lnRecCnt
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform