home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / uswar.zip / BORDER.PAS < prev    next >
Pascal/Delphi Source File  |  1985-12-06  |  1KB  |  48 lines

  1. Procedure Border( x,y,xl,yl,t,fg,bg:integer);
  2. {This procedure will draw a double line border. Upper left corner will
  3.  be located at x,y. The border size will be xl by yl. t describes the border
  4.  type 1=double, 2= single, 3=double horiz single vert, 4=vice versa.}
  5.  
  6. CONST
  7.     s1 = '╔╗╚╝║═';
  8.     s2 = '┌┐└┘│─';
  9.     s3 = '╓╖╙╜║─';
  10.     s4 = '╒╕╘╛│═';
  11.  
  12. VAR
  13.     ul,ur,bl,br,up,sd:char;
  14.     tdat:string[6];
  15.  
  16. Begin
  17.  
  18. case t of                           {Select border configuration}
  19.      1: tdat:=s1;
  20.      2: tdat:=s2;
  21.      3: tdat:=s3;
  22.      4: tdat:=s4;
  23. end;
  24. ul:=copy(tdat,1,1);
  25. ur:=copy(tdat,2,1);
  26. bl:=copy(tdat,3,1);
  27. br:=copy(tdat,4,1);
  28. up:=copy(tdat,5,1);
  29. sd:=copy(tdat,6,1);
  30.  
  31. Gotoxy(x,y);
  32. FastWrite(ul,fg,bg,1);                          {Draw top line}
  33. for i:=x to x+xl-3 do FastWrite(sd,fg,bg,1);
  34. FastWrite(ur,fg,bg,1);
  35. for i:=y+1 to y+yl-2 do                       {Draw side bars}
  36.    begin
  37.       gotoxy(x,i);
  38.       FastWrite(up,fg,bg,1);
  39.       gotoxy(x+xl-1,i);
  40.       FastWrite(up,fg,bg,1);
  41.    end;
  42. gotoxy(x,y+yl-1);
  43. FastWrite(bl,fg,bg,1);                          {Draw bottom line}
  44. for i:=x to x+xl-3 do FastWrite(sd,fg,bg,1);
  45. FastWrite(br,fg,bg,1);
  46.  
  47. end;
  48.