{********************************}
{*   This Procedure Display a   *}
{*   Single or Double Line Box  *}



procedure DrawBox(x1,y1,x2,y2 : Integer;box_var : char);
 Var I : Integer;
     cv1,cv2,cv3,cv4,cv5,cv6 : integer;
 begin
   if box_var = 's' then       {** Single Line **}
    begin
     cv1 := 218; cv2 := 196; cv3 := 191;
     cv4 := 179; cv5 := 192; cv6 := 217;
    end;
    if box_var = 'd' then      {** Double Line **}
     begin
      cv1 := 201; cv2 := 205; cv3 := 187;
      cv4 := 186; cv5 := 200; cv6 := 188;
      end;
   GotoXY(x1,y1);
   write(chr(cv1));
    for I := x1 to x2-1 do write(chr(cv2));
    GotoXY(x2,y1); write(chr(cv3));
     for I := y1+1 to y2 do
      begin
       GotoXY(x1,I); write(chr(cv4));
       GotoXY(x2,I); write(chr(cv4));
      end;
      GotoXY(x1,y2);
      write(chr(cv5));
      for I := x1 to x2-1 do write(chr(cv2));
    GotoXY(x2,y2); write(chr(cv6));
 end;  {** end procedure DrawBox **}

{***  Driver ***}
begin
 clrscr;

 {*  Pass Column & Row Position of    *}
 {*  Upper Left & Lower Left Corners  *}
 {*  Also d for Double & s for Single *}
 {*           Line Box                *}

 DrawBox(10,10,70,20,'d');
end.