FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour seterrorfilename
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM

seterrorfilename

Posted: Thu Nov 19, 2015 11:25 AM
Hi,
If I Compile and run this program with last version of Fivewin
I find error.log in current folder and not c:\marco.log
what's wrong?
Bye


Code (fw): Select all Collapse
#include "fivewin.ch"


FUNCTION MAIN()
LOCAL cDbf := "marco->codice"

SetErrorFileName( "c:\marco.log" )

? &(cDbf)

RETURN NIL
Marco Boschi
info@marcoboschi.it
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: seterrorfilename

Posted: Thu Nov 19, 2015 12:47 PM
Marco,

there are two problems:

1. you have to specify the path separately using SetErrorPath()

2. there is an error in the function SetErrorFileName()

This is the fixed sample:

#include "fivewin.ch"


FUNCTION MAIN()
Code (fw): Select all Collapse
LOCAL cDbf := "marco->codice"

SetErrorPath( "c:\" )
SetErrorFileName( "marco.log" )

? &(cDbf)

RETURN NIL


function SetErrorFileName( cFileName )
   local cOldFileName
   static cErrorFileName := "error.log"

   cOldFileName = cErrorFileName

   if PCount() == 1 .and. ValType( cFileName ) == "C"
      cErrorFileName = cFileName
   endif

return cOldFileName


EMG
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM

Re: seterrorfilename

Posted: Thu Nov 19, 2015 01:42 PM

Thank You Enrico

Marco Boschi
info@marcoboschi.it

Continue the discussion