TIP: Click on subject to list as thread! ANSI
echo: z3_pascal
to: Peter Lavender
from: Doug Brendish
date: 1996-05-29 21:57:34
subject: Placing a box around my menus?

PL> Here is what I have done.. I really only need an example of 
PL> a valid line to handle this sort of thing.

Here is your code with a few changes.. Note the constant declarations.. Hex
numbers need a $ in front of them or put the decimal equivilent.

program testbox;
uses  crt;
procedure DrawBox (StartCol, StartRow, BoxLength, BoxWidth: integer);
const
  Horiz = char($ba);
  Vert = char($BA);
  TopLeft = char($C9);
  TopRight= char($BB);
  BotLeft=char($C8);
  BotRight= char($BC);
var
  Cnt, TopRCorn, TopLCorn, BotRCorn,botlcorn,i: integer;

begin
  gotoxy(StartCol,StartRow);
  Write(TopLeft);
  TopRCorn:= StartCol+BoxLength;
  for i:=1 to boxlength-1 do write(horiz);  {write top}
  gotoxy(TopRCorn, StartRow);
  Write (TopRight);
  Botlcorn:=StartRow+BoxWidth;
  gotoxy(StartCol,BotLCorn);
  Write (BotLeft);
  for i:=1 to boxlength-1 do write(horiz);{write bottom}
  gotoxy(TopRCorn,BotLCorn);
  Write (BotRight);
  for i:= 1 to boxwidth-1 do {write sides}
  begin
   gotoxy(startcol,startrow+i);
   write(vert);
   gotoxy(startcol+boxwidth,startrow+i);
   write(horiz);
  end;
end;


var
  SC, SR, Length, Width: integer;

BEGIN
  clrscr;
  WriteLn('Start Column ');
  ReadLn (SC);
  WriteLn('Start Row ');
  ReadLn(SR);
  WriteLn('Length ');
  ReadLn(Length);
  WriteLn ('Width ');
  ReadLn(Width);
  DrawBox (SC, SR, Length, Width);
  readln;
END. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Doug

--- Msgedsq/2 3.10
* Origin: Tir na nOc 066 245944 -=Cead mile failte=- (3:626/667)
SEEN-BY: 633/267 270
@PATH: 626/667 660 711/401 808 50/99 635/544 727 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.