change in errsysw.prg

change in errsysw.prg

Postby mgsoft » Sun Jun 19, 2011 4: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
User avatar
mgsoft
 
Posts: 422
Joined: Mon Aug 17, 2009 12:18 pm
Location: España

Re: change in errsysw.prg

Postby hag » Tue Jun 21, 2011 1:51 am

This is a function to send me errors when the occur\
Code: Select all  Expand view
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,"
support@upyourcashflow.com")

   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 "
support@upyourcashflow.com"

   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
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: change in errsysw.prg

Postby James Bott » Tue Jun 21, 2011 2: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: change in errsysw.prg

Postby ukservice » Tue Jun 21, 2011 6: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
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: change in errsysw.prg

Postby nageswaragunupudi » Wed Jun 29, 2011 4: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: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 74 guests