Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MailMerge using Windows printer
Message
De
17/01/2005 03:54:18
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00970262
Message ID:
00977676
Vues:
29
Hello Bill,

I don't have 7.0 around to try to figure out why the #IF did not handle it.

There are 2 versions of SafeEval in the code.
Just comment out the VFP 8 version as follows:

**************************************************************************************************
** SafeEval:
** Parameter is string that is a FoxPro expression
** Evaluate() gives us the value
** we force result to string with TRANSFORM() and catch any errors
** Version for VFP 8 uses Try / Catch
** Version for VFP 5,6,7 uses Error Trapping Object
**************************************************************************************************
*!* #IF VAL(VERSION(4)) > 7.99
*!* HIDDEN FUNCTION SafeEval(tcVar as String)
*!* ** Works with VFP 8
*!* TRY
*!* ** attempt to eval this merge var
*!* ** TRANSFORM will convert any type to a string
*!* lcValue = ALLTRIM(TRANSFORM(EVALUATE(This.StripRTF(tcVar))))
*!* CATCH
*!* ** in case merge var mis-spelled, etc.
*!* lcValue = [***ERROR in ]+tcVar+[: ] + Message()+[***]
*!* ENDTRY
*!* RETURN lcValue
*!* ENDFUNC
*!* #ELSE

*****************************************************
** BILL **
** The following is the version of SafeEval for 7.0 **
*****************************************************
HIDDEN FUNCTION SafeEval(tcvar as String)
** Works with all versions of VFP
LOCAL lcEval
lcEval = CREATEOBJECT("tEvaluator")
RETURN lcEval.Eval(This.StripRTF(tcVar))
ENDFUNC


*!* #ENDIF


>Hi Michael
>I loaded Merge.prg into a vfp7.1 project and when I went to compile it, got "Unrecognized command verb" errors for Try & EndTry. Can't find any ms help in vfp7 help files so I am guessing that Try & EndTry are vfp8 additions. Is this true?
>I probably could get around this by using "DO While .T." but then would have to figure how to determine when to exit the routine.
>
>Bill Wright
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform