{
Dialog with Error message
}
procedure Error(msg:String);
var b:Boolean; i,t:Integer;
begin
 if Length(Trim(msg))>0 then begin
  Success('ERROR:');
  if EditState=0 then begin
   t:=StringToText(msg);
   if Text_NumLn(t)>0 then begin 
    for i:=0 to Text_NumLn(t)-1 do begin
     if i=0
     then msg:=Edit('('+Text_GetLn(t,i))
     else msg:=Edit(' '+Text_GetLn(t,i));
     Success(' '+Text_GetLn(t,i));
    end; 
    msg:=Edit(')Error ___Error___');
   end;
   b:=Text_Free(t);
  end else b:=Echo('ERROR:'+CRLF+msg);
 end;
end;
{
if EditState=1 then begin
 if IsSameText(ExtractWord(1,Edit('?ans 0')),'___Error___') then Details(Edit(''));
end;
}