| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Placing a box around my menus? |
Hi All,
I would like to place a box around the outside of my menus, so rather than
'draw' the box in the code, I know it's pretty bad but that's what I did
last time :(, I'd like to do all this in one procedure having the starting
X,Y co-ords. length and width passed in from the calling procedure..
So far I think I have done that, BUT, I can't define the ANSI lines as
constants.. could some one show me how?
Here is what I have done.. I really only need an example of a valid line to
handle this sort of thing.
*-=-=-=-=[ Begin: box.pas ]-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
program testbox;
uses
crt;
procedure DrawBox (StartCol, StartRow, BoxLength, BoxWidth: integer);
const
Horiz : chr(ba);
Vert : chr(BA);
TopLeft: chr(C9);
TopRight: chr(BB);
BotLeft:(C8);
BotRight: (BC);
var
Cnt, TopRCorn, TopLCorn, BotRCorn: integer;
begin
clrsrc;
gotoxy(StartCol,StartRow);
Write(TopLeft);
TopRCorn:= StartCol+BoxLength;
gotoxy(TopRCorn, StartRow)
Write (TopRight);
BotLCorn:=StartRow+BoxWide;
gotoxy(StartCol,BotLCorn);
Write (BotLeft);
gotoxy(TopRCorn,BotLCorn);
Write (BotRight);
end;
var
SC, SR, Length, Width: integer;
BEGIN
WriteLn('Start Column ');
ReadLn (SC);
WriteLn('Start Row ');
ReadLn(SR)
WriteLn('Length ');
ReadLn(Length);
WriteLn ('Width ');
ReadLn(Width);
DrawBox (SC, SR, Length, Width);
END. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ End: box.pas ]*
If there are errors in the code it's becuase I can't get past the costant
declarations.. :(
I guess there is an easier way? Like inbuilt functions?
Thanks,
Pete
... I am a fool!" Spock, 'City on the Edge of Forever
--- TossingReality 1.02+
* Origin: Back from Reality. Files?? Pfff Yeah Sure! (3:635/309)SEEN-BY: 633/267 270 @PATH: 635/309 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™.