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:
00633781
Message ID:
00634474
Vues:
18
>>Hi Eric.
>>
>>>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?
>>
>>How about having your error handler just RETURN if the error occurs while using TEXTMERGE()? I do that using code like:
This.lTextMerge = .T.
>>textmerge(whatever)
>>This.lTextMerge = .F.
>>
>>function Error...
>>if This.lTextMerge
>>  return
>>else
>>  rest of code
>>endif
Doug
>
>Many thanks Doug. Most of the time the solution is so simple!

In the case of missing variables the line
lcResult = textmerge(whatever)
will be skipped and variable lcResult wouldn't be changed.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform