BTW, do you need to use TEXTMERGE to write to the log file? Can you use strtofile() instead?
>I've got a simple method, CanOpen() which tests if a passed .dbf file name can actually be opened (i.e. it's not corrupted, etc.) The former version used ON ERROR and worked fine, but I've decided to update it to use TRY...CATCH instead.
>
>LPARAMETERS ;
> tcConfigFile
>
>LOCAL ;
> llRetVal
>
>llRetVal = .T.
>
>TRY
> USE ( tcConfigFile ) ALIAS Config IN 0 EXCLUSIVE
>
>CATCH
> llRetVal = .F.
>
>ENDTRY
>
>IF USED( "Config" )
> USE IN Config
>
>ENDIF
>
>RETURN llRetVal
>
>In testing, this code *seems* to return the correct value, but I'm getting some side effects. I have a log file open with SET TEXTMERGE TO ..., and after this code runs messages no longer get written to the log file.
>
>I haven't used TRY...CATCH much, maybe I've got the syntax completely wrong.
If it's not broken, fix it until it is.
My Blog