Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MailMerge using Windows printer
Message
From
17/01/2005 03:54:18
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00970262
Message ID:
00977676
Views:
30
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform