Untuk kesempatan kali ini, saya akan mencoba membuat prosedur membuat box. Langsung saja berikut adalah listing programnya yang dicompile dengan compiler FreePascal

uses crt;

var
i:integer;

procedure box(x,y,w,h,c:integer);
var
i,j:integer;
begin
textcolor(15);
textbackground(c);
gotoxy(x,y);
write(chr(201));
for i:=1 to w do
begin
gotoxy(x+i,y);
write(chr(205));
end;
gotoxy(x+i+1,y);
write(chr(187));
for j:=1 to h do
begin
gotoxy(x,y+j);
write(chr(186));
for i:=1 to w do
begin
gotoxy(x+i,y+j);
write(chr(32));
end;
gotoxy(x+i+1,y+j);
write(chr(186));
end;
gotoxy(x,y+j+1);
write(chr(200));
for i:=1 to w do
begin
gotoxy(x+i,y+j+1);
write(chr(205));
end;
gotoxy(x+i+1,y+j+1);
write(chr(188));
end;
begin
clrscr;
box(10,5,40,15,1);
readln;
end.