ed.ex / edx.ex :: get_err_line()

new topic     » topic index » view thread      » older message » newer message
---------------------------------------------- 
--      replace each call to:               -- 
--              goto_line(start_line, 1)    -- 
--              set_err_pointer()           -- 
--              show_message()              -- 
--                                          -- 
--      with a call to:                     -- 
--              show_error_message()        -- 
---------------------------------------------- 
procedure show_error_message() 
     
    -- set cursor at point of error 
    goto_line(start_line, start_col) 
    previous_word() 
     
    /*   

	display error message from ex.err 
	from ex. err on the status line 
	(top line menu bar):  
    */ 
    if length(error_message) > 0 then 
	set_top_line("") 
	puts(SCREEN, error_message) 
	normal_video() 
    end if 
     
    set_position(s_line, s_col) 
     
end procedure 
 
function get_err_line() 
    ------------------------------------------------------- 
    --    derived from Irv Mulling's, gneui.ex           -- 
    --    which was a major rewrite of my program,       -- 
    --    gneui.ex, which was derived from               -- 
    --    get_err_line(). All the world's a circle.      --        
    ------------------------------------------------------- 
    object file, file_lines 
    natural colon_pos = 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 find('^', file_lines[n]) then 
		colon_pos = find(':',file_lines[1]) 
		start_col = find('^', expand_tabs(STANDARD_TAB_WIDTH, file_lines[n])) 
		file = file_lines[1][1..colon_pos-1] 
		start_line = to_number(file_lines[1][colon_pos+1..$]) 
		return file 
	    end if 
	end for 
    end if 
return "" 
end function 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu