Errorsysw.prg

Errorsysw.prg

Postby byte-one » 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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Errorsysw.prg

Postby StefanHaupt » 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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Errorsysw.prg

Postby byte-one » 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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Errorsysw.prg

Postby Daniel Garcia-Gil » Wed Aug 18, 2010 1:19 pm

Hello

what do you thinks about this way...

in errsysw.prg

add this function

Code: Select all  Expand view
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: Select all  Expand view

MemoWrit( SetErrorPath() + "Error.log", cErrorLog )
 


now we can call from main prg SetErrorPath( cPath )

example
Code: Select all  Expand view

#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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Errorsysw.prg

Postby byte-one » Wed Aug 18, 2010 2: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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Errorsysw.prg

Postby Daniel Garcia-Gil » Wed Aug 18, 2010 3: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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Errorsysw.prg

Postby byte-one » Wed Sep 01, 2010 1:41 pm

Daniel, only the default path from the error.log should be
Code: Select all  Expand view
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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 75 guests