Re: edx.ex :: function get_err_line() replacement

new topic     » goto parent     » topic index » view thread      » older message » newer message

Once more, with feeling... This version uses expand_tabs to position the cursor accurately on the error column. I edited the original post so that it now contains this code.

I am experimenting with some code that will utilize Irv Mullins' code to "trap and process GTK signal 11 errors" by having edx.ex open another window and display the relevant information there.

-- file: edx.ex 
function get_err_line() 
    ---------------------------------------- 
    --  derived from Irv Mulling's, gneui.ex 
    ----------------------------------------- 
    object file_lines 
    object file 
    object temp_line 
    object err_line 
    integer err_col = 0, i = 0 
     
    file_lines = read_lines("ex.err") 
    if atom(file_lines) then   
	error_message = "" 
	return "" 
	break    
    else 
	error_message = trim_tail(file_lines[2]) 
	for n = 1 to length(file_lines) do 
	    if match("^^^ call-back from external source",file_lines[n]) = 1 then 
		file_lines = file_lines[1..n-1] 
		exit 
	    end if 
	end for 
	-- trap & process euphoria error report; 
	for n = 1 to length(file_lines) do 
	    if find('^', file_lines[n]) then 
		i = find(':',file_lines[1]) 
		err_col = match("^", expand_tabs(STANDARD_TAB_WIDTH, file_lines[n]))-1 
		file = file_lines[1][1..i-1] 
		err_line = to_number(file_lines[1][i+1..$]) 
		start_col = err_col 
		start_line = err_line 
		return file 
	    end if  
	end for 
    end if 
end function  
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu