// ############################## START FUNC ############################################ // ****************************** window.onerror=display_error; // ****************************** // This is an error routine. The JavaScript statement above supress errors to be handeled // by the routine instead of with the normal error message. This is crucial when all // functions in the program are separated as in the folder "functions". You have to know // which function that provokes the error and better also where the inadequate rows can be // found (likely). function display_error(error_type,calling_script,row_NR){ var function_with_error=display_error.caller; //------------------------------------------------------------ // This routine is necessary because the text messages within // the error report cant be handeled as strings without hazzle. // In order to correctly display functional calls, the windows // are better visible and separate. document.form1.errorFunction.value = function_with_error; document.form1.errorRow.value = row_NR; document.form1.errorType.value = error_type; document.form1.errorSource.value = calling_script; var function_with_error = document.form1.errorFunction.value; var row_NR = document.form1.errorRow.value; var error_type = document.form1.errorType.value; var calling_script = document.form1.errorSource.value; //------------------------------------------------------------ var temp=error_type.split("\'"); error_type=temp.join("#"); var j = function_with_error.indexOf("("); var i = function_with_error.lastIndexOf(" ",j); i++; var function_name = function_with_error.substring(i,j); // The calling function with the error is stored in its full length in function_with_error. // The function name can now be read as the substring herein from position i to position j. // Below, one frame is opended with the complete text for that function INCLUSIVE // introducing comments, which make the row no. correct. Else invisible row breaks can also // be captured in this way. parent.right.ute1.location="functions/"+function_name+".txt"; // In order to read the frame, a delay is neaded. But no functional calls are allowed from // an error routine. The way to get the delay, reading of the frame, and action (writing a // message in the whole right frame) is to get it from a separate frame. This is done by // completing an entire document, which is stored in toWrite and written out. var toWrite="\n\n\n\n\nfunction handle(){\n\ndocument.form1.text1.value=\"\\n\";\nvar b=document.form1.text1.value;\n\nerror_type=\""+error_type+"\";\nfunction_name=\""+function_name+"\";\ndocc=\""+calling_script+"\";\nrow_NR="+row_NR+";\n\nvar message=\"

   Error Type \"+error_type+\"
   Function Name \"+function_name+\"
   Document Name \"+docc+\"
   Error on Row \"+row_NR+\"


\";\n\nvar text_read_write=parent.ute1.document.all[3].innerHTML;\ntext_read_write=text_read_write.replace(\"\",\"\");\ntext_read_write=text_read_write.replace(\"\",\"\");\ntext_read_write=text_read_write.replace(\"
\",\"\");\ntext_read_write=text_read_write.replace(\"
\",\"\");\n\ndocument.form1.text1.value=text_read_write;\n\nvar function_with_error=document.form1.text1.value;\n\nvar rows=function_with_error.split(\"<\");\nfunction_with_error=rows.join(\"<\;\");\nrows=function_with_error.split(\">\");\nfunction_with_error=rows.join(\">\;\");\n\nrows=function_with_error.split(b);\nrows[row_NR-4]=\"\"+rows[row_NR-4];\nrows[row_NR-(-0)]=rows[row_NR-(-0)]+\"\";\nfunction_with_error=\"\"+message+rows.join(\"
\")+\"\";\n\nparent.document.write(function_with_error);\n\nreturn true;\n\n\n\n}\n\n
\n\n\n\n\n
\n\n\n
\n\n\n\n\n"; parent.right.ute2.document.write(toWrite); parent.right.ute2.location.reload(); // It is necessary to reload the frame to get action. } // ############################### end func ############################################