Page 6 of 6

Re: On error...

Posted: Mon Jul 30, 2012 5:52 am
by Rathinagiri
61 years! Great!

With immense happy I salute you sir!

Re: On error...

Posted: Mon Jul 30, 2012 5:57 am
by Dilip Patel
Hi Rathi,
Thank you. I have great admiration for you. You have been doing a splendid job for the community (HMG) and I salute YOU.
Regards,
Dilip

Re: On error...

Posted: Mon Jul 30, 2012 12:30 pm
by esgici
Hi Dilip
Dilip Patel wrote:I am 61 years old.
You are welcome to oldies club 8-)

Long live ! I'm the oldest member yet :mrgreen:
Dilip Patel wrote:The truncation of the variable name is as a result of Harbour writing only 10 characters...
In fact, Clipper and Harbour allows long identifiers. The 10 characters limit come from old dBase era.
Dilip Patel wrote:... no other way of knowing or obtaining the stored variables in memory.
Be patient a little more, please. My work is almost finised.
Dilip Patel wrote:...Thanks to HMG and Harbour to date no crashes. Wonderfull sets of programs.
You are welcome to wonderland :D

Viva Harbour, viva HMG !

Regards

--

Esgici

Re: On error...

Posted: Mon Jul 30, 2012 12:55 pm
by Dilip Patel
Hi Esgici,
Being OLD, with us patience is a virtue. Am awaiting to see the results of your work!
Regards,
Dilip

Re: On error...

Posted: Wed May 02, 2018 2:15 pm
by koke
Hola, esto fue muy útil, así que una pequeña contribución al código dado por esgici solo para guardar el resultado del error en un archivo para que el programa pueda cerrarse y aún así puedas saber el error. Gracias.

Hi, these was very helpful, so a little contribution to the code given by esgici just to save the error result to a file so the program can be closed and you can still know the error from it. Thank you

Code: Select all

PROCEDURE SimpleErrorHandler( oCurrentError  )  // Simple Error handle procedure

   LOCAL cErrDetail   :=  '',;
         cFileAsc2Err := IF( EMPTY( oCurrentError:filename ), "None", oCurrentError:filename ),;
		 errortraido := ""

		errortraido := errortraido + "A Run Time Errror Occured :" + CRLF + CRLF
        errortraido := errortraido + "Error " 
        errortraido := errortraido + oCurrentError:subSystem +'/'                  // BASE
        errortraido := errortraido + LTRIM( STR( oCurrentError:subCode ) ) + ": " // 1003
        errortraido := errortraido + oCurrentError:operation                           // xVaribleUnExist
        errortraido := errortraido + CRLF + CRLF 
        errortraido := errortraido + "R.T.Error" + CRLF
		errortraido := errortraido + CallSequence() + CRLF + CRLF
        errortraido := errortraido + "Can Substitute ? " + IF( oCurrentError:canSubstitute, "Yes", "No" ) + CRLF 
        errortraido := errortraido + "Can Retry ? "      + IF( oCurrentError:canRetry,      "Yes", "No" ) + CRLF 
        errortraido := errortraido + "Can Default ? "    + IF( oCurrentError:canDefault,    "Yes", "No" ) + CRLF
        errortraido := errortraido + "Op. Sys. Err. Code : " + LTRIM( STR( oCurrentError:osCode ) )  + CRLF 
        errortraido := errortraido + "Generic Error Code : " + LTRIM( STR( oCurrentError:genCode ) ) + CRLF
        errortraido := errortraido + "Associated File : "    + cFileAsc2Err  + CRLF
        errortraido := errortraido + "Severity : " + LTRIM( STR( oCurrentError:severity  ) )
		nombrearch := "errorlog.log"

    If (nManejalog := fcreate(nombrearch,0)) == -1
		MsgBox("No se puede crear el fichero:", FERROR())
		Return
	Else
		fwrite(nManejalog,errortraido)
		FCLOSE(nManejalog)
		FCLOSE(nManejalog)
	EndIf
RETURN