seterrorfilename

seterrorfilename

Postby MarcoBoschi » 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: Select all  Expand view  RUN
#include "fivewin.ch"


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

SetErrorFileName( "c:\marco.log" )

? &(cDbf)

RETURN NIL
 
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: seterrorfilename

Postby Enrico Maria Giordano » 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: Select all  Expand view  RUN

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
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: seterrorfilename

Postby MarcoBoschi » Thu Nov 19, 2015 1:42 pm

Thank You Enrico
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 66 guests