FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour change in errsysw.prg
Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
change in errsysw.prg
Posted: Sun Jun 19, 2011 04:54 PM

Hi,

Is possible that the dialog is a little more bigger, because some times the text does not show all lengh in:

@ 0, 20 SAY oSay PROMPT OemToAnsi( cMessage ) ;
CENTERED OF oDlg FONT oFont SIZE 400, 20

Also, is it possible to add a Button to send the error.log via MAIL/MAPI?.

Thank you. Those changes are very usefull and avoid to change erssysw.prg in each FWUpdate ;)

Saludos,



Eduardo
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: change in errsysw.prg
Posted: Tue Jun 21, 2011 01:51 AM
This is a function to send me errors when the occur\
Code (fw): Select all Collapse
function james() 
   local oMail,aCustomer:={} 
   local cSubject:="Error file" 
   local cWhich     
   local curDir  := curDir()    
   local curDri  := curDrive()  
   local cMessage:="" 
   local aFiles  := {}  
   local cName  
   local cEntity, cName2, cTele,oGet1,oGet2,oDlg3
   local cDemo  

   // are they using a demo or did they purchase     
   if lDemo  // .T.  == demo
      cDemo := "Demo"
   else
      cDemo := "User"
   endif

   if !isAlias("company")
      use company alias company new
   endif        

   cEntity := company->gld
   cEntity := right(cEntity,8)
   cEntity := left(cEntity,2)

   tone(777)
   tone(555)
   tone(777)

   if isAlias("gl")
      select gl
      gl->(dbsetOrder(1))
   else     
      use   ("gl.d"+cEntity) alias gl new
      index on gl->account to errmail
   endif

   gl->(dbseek("1000"))   
   cName := gl->aa17


   DEFINE FONT oFont7 NAME "Ms Sans Serif" SIZE 0,-12
   DEFINE DIALOG ODLG3 RESOURCE "errmess" font ofont7

   REDEFINE get oGet1 var cName2 ID 4003 OF oDlg3
   REDEFINE get oGet2 var cTele  ID 4004 OF oDlg3 picture "999-999-9999"
   REDEFINE BUTTON ID 4002 OF oDlg3 ACTION (odlg3:end())    

   ACTIVATE DIALOG oDlg3 centered

   cWhich := curdri+":\"+curDir+"\"+"error.txt"         

   aFiles:={"cWhich","Error.txt"} 

// where to send error message
   aadd(aCustomer,"<!-- e --><a href="mailto:support@upyourcashflow.com">support@upyourcashflow.com</a><!-- e -->") 

   DEFINE MAIL oMail  ; 
   SUBJECT cSubject   ; 
     TEXT  allTrim(cName)+CRLF+DTOC(DATE())+" "+TIME()+CRLF+"Version xt2011, date: "+cVersion+" "+cDemo+CRLF+; 
                 alltrim(cName2)+" "+cTele ;
     FILES curdri+":\"+curDir+"\"+"error.txt","Error.txt"   ;
     TO "<!-- e --><a href="mailto:support@upyourcashflow.com">support@upyourcashflow.com</a><!-- e -->"

   ACTIVATE MAIL oMail 

     msgInfo("Notice sent  ") 

CLOSE ALL 

SET RESOURCES TO 
ErrorLevel( 1 ) 
QUIT


return nil



Let me know if it helps
Thank you

Harvey
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: change in errsysw.prg
Posted: Tue Jun 21, 2011 02:08 PM

You could try just adding some spaces to the end of cMessage. This way the part that might not show would always just be blank spaces.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: change in errsysw.prg
Posted: Tue Jun 21, 2011 06:19 PM
Yes, I can fix it, but it is a waste of time patching FWH classes with each new build.

Also, there are 2 or 3 releases each month.

I think it is very useful to add both changes (more space and a button to send the error via MAPI).

But maybe I am wrong.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: change in errsysw.prg
Posted: Wed Jun 29, 2011 04:01 AM
Also, is it possible to add a Button to send the error.log via MAIL/MAPI?.


FWH 11.06 provides for specifying post error action and here the programmer can implement his own behavior after an error is displayed in the dialog,

At the start of the program:
Code (fw): Select all Collapse
SetPostErrorAction( { |cErrorLog, oError| MyOnError( cErrorLog, oError ) } ) 

.....

function MyOnError( cErrorLog, oError )

 <here have the programmer's code to email cErrorLog or any other action>

return nil
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion