procedure write_time;
var hour,minute,second,sec100:word;am:boolean;
begin
 gettime(hour,minute,second,sec100);
 if hour<10 then write('0');
 am:=true;
 if hour>12 then
 begin
  am:=false;
  hour:=hour-12;
 end;
 write(hour);
 write(':');
 if minute<10 then write('0');
 write(minute);
 if am then write('am') else write('pm');
end;
procedure write_date;
var year,month,day,dow:word;
begin
 getdate(year,month,day,dow);
 if month<12 then write('0');
 write(month,'/');
 if day<12 then write('0');
 write(day,'/');
 year:=year-1900;
 if year<10 then write('0');
 write(year);
end;

procedure we(s:string);
    begin
     write(#27+'['+s+'m');
    end;

procedure do_me(k_me:string);
begin
       if k_me='00' then we('0;30') else
       if k_me='01' then we('0;34') else
       if k_me='02' then we('0;32') else
       if k_me='03' then we('0;36') else
       if k_me='04' then we('0;31') else
       if k_me='05' then we('0;35') else
       if k_me='06' then we('0;33') else
       if k_me='07' then we('0;37') else
       if k_me='08' then we('1;30') else
       if k_me='09' then we('1;34') else
       if k_me='10' then we('1;32') else
       if k_me='11' then we('1;36') else
       if k_me='12' then we('1;31') else
       if k_me='13' then we('1;35') else
       if k_me='14' then we('1;33') else
       if k_me='15' then we('1;37') else
       if k_me='B0' then we('40') else
       if k_me='B1' then we('44') else
       if k_me='B2' then we('42') else
       if k_me='B3' then we('46') else
       if k_me='B4' then we('41') else
       if K_me='B5' then we('45') else
       if K_me='B6' then we('43') else
       if K_me='B7' then we('47') else
       if k_me='CT' then write_time else
       if k_me='CD' then write_date else

       write('|'+k_me);
end;
