FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Errorsysw.prg
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Errorsysw.prg
Posted: Wed Aug 18, 2010 10:20 AM

Hello!
I installed my program on a computer with Win7 (64bit) in the standard directory "Program Files (x86)". In this case, the error.log can not be written! The path of the error.log must! be able to change as in win7 on the install-directorys are no rights to write as default!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Errorsysw.prg
Posted: Wed Aug 18, 2010 10:38 AM
Hi,

see my changes to errsysw.prg here

http://forums.fivetechsupport.com/viewtopic.php?f=3&t=14050&p=72261#p72261

The path for error.log is automatically set.
kind regards

Stefan
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Errorsysw.prg
Posted: Wed Aug 18, 2010 11:53 AM

Thanks Stefan!
Your or another code should be transferred to FIVEWIN for the future!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Errorsysw.prg
Posted: Wed Aug 18, 2010 01:19 PM
Hello

what do you thinks about this way...

in errsysw.prg

add this function

Code (fw): Select all Collapse
function SetErrorPath( cPath )
   local cOldPath
   static cErrorPath := ".\"
   
   cOldPath = cErrorPath

   if PCount() == 1 .and. ValType( cPath ) == "C"
      cErrorPath = cPath
   endif

return cOldPath

Return last path used, without argument return current path

change
Code (fw): Select all Collapse
MemoWrit( SetErrorPath() + "Error.log", cErrorLog )


now we can call from main prg SetErrorPath( cPath )

example
Code (fw): Select all Collapse
#include "fivewin.ch"
function main
   local aArray := {}

   ? SetErrorPath() //return current path
   ? SetErrorPath( "c:\Errors\") //return last path used
   ? SetErrorPath() //return current path
   //force error
   aArray[ 2 ] = 1
RETURN NIL
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Errorsysw.prg
Posted: Wed Aug 18, 2010 02:20 PM

Ok, functioning. But the default of the path should be "getenv("TEMP")+"\"" ?
The call to notepad should also be "Notepad.exe "+setErrorPath()+"Error.log"

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Errorsysw.prg
Posted: Wed Aug 18, 2010 03:07 PM
byte-one wrote:Ok, functioning. But the default of the path should be "getenv("TEMP")+"\"" ?

from begining the default path is same application path, sorry but we can not change the default path now

byte-one wrote:The call to notepad should also be "Notepad.exe "+setErrorPath()+"Error.log"

yes right...

this function is not implemented in fivewin... was just a idea
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Errorsysw.prg
Posted: Wed Sep 01, 2010 01:41 PM
Daniel, only the default path from the error.log should be
Code (fw): Select all Collapse
 DEFAULT if(!empty(getenv("TEMP")),getenv("TEMP")+"\",".\")
in the function seterrorpath().
In the future, WINDOWS 7 is the standard OS and no extra call to seterrorpath() should required!
Regards,
Günther
---------------------------------
office@byte-one.com

Continue the discussion