Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TextMerge with FileToStr and Macro Sub Problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
TextMerge with FileToStr and Macro Sub Problem
Divers
Thread ID:
00752784
Message ID:
00752784
Vues:
57
I am trying to make a text file template, read it into a string, merge the contents with textmerge, and return the final string.

Why would the below code not work?

Thanks.
Function MergeMe
Lparameters aliasName as String , templateName as String 
	Local ;
		xxxDbc as Exception , ;
		outValue as String , ;
		templateText as String
	Local ;
		mergeText as String 
	templateText = FileToStr( templateName )
	? templateText + Chr(13)+Chr(10) +":"+Chr(13)+Chr(10)
	Set TextMerge Delimiters To "{{" , "}}" 
*!*				set textmerge to MemVar mergeText
*!*				set textmerge on
*!*				   \\{{Datetime()}}
*!*				   \
*!*				set textmerge off
*!*				set textmerge to
	set textmerge to MemVar mergeText
	set textmerge on
	   \\&templateText
	   \
	set textmerge off
	set textmerge to
Return mergeText
EndFunc
textboxstring.template file contents:
Datetime()
Thanks.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform