function errorbox(instr)

if ~nargin, instr = []; end

err = lasterr;
lasterr('')
stack = dbstack;
if ~isempty(stack),
	str = strvcat(['??? ' err],' ');
	for ii=2:size(stack,1),
		str = strvcat(str,['Error in ==> ' stack(ii).name]);
		str = strvcat(str,['        On line ' int2str(stack(ii).line)]);
	end
else
	str = '???';
end
if ~isempty(instr),
	str = strvcat(str,' ');
	str = strvcat(str,instr);
end
uiwait(msgbox(str,'modal'))