Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to avoid error for undefined var with TEXTMERGE?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00633782
Message ID:
00633797
Vues:
17
>Hello,
>
>I have a program that reads a html file (using FILETOSTR) and I am processing it with the TEXTMERGE command in order to replace things like
<<lname>>
with the content of the variable lname. My problem is that, if there is an error in the file, specifically the lname variable is not defined, the TEXTMERGE gives an error. Is there a way to make it work like the TEXT...ENDTEXT command that just put nothing in the replacement in this case but don't produce any error?
>
>
>Thanks
>Eric

You can test the for the string with AT() before the textmerge.
IF AT("<<lname>>",lcFileContent) > 0
  ...textmerge...
ENDIF
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform