home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
CON-03A.ZIP
/
ONELINER.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-11-16
|
4KB
|
190 lines
unit oneliner;
interface
procedure set_options;
procedure init_asc;
procedure read_data_file;
procedure add_oneliner;
procedure menu;
procedure one_liner_run;
implementation
{$R-}
uses crt,
mmenu,
funct;
type
one_liner = record
lineswap : array[1..12] of string[78];
{ author : array[1..12] of string[30];}
end;
var
f1 : text;
f : file of one_liner;
one : one_liner;
i : integer;
i2 : integer;
option : integer;
options : array[1..3] of string[17];
choice : char;
grid_ref : byte;
cows_come_home : boolean;
liner : string;
tmp11 : string[50];
len : integer;
procedure set_options;
begin
options[3]:=' enter oneliner ';
options[2]:=' info on line ';
options[1]:=' exit groovyLINE ';
end;
procedure init_asc;
var
ch : char;
begin
clrscr;
send_ansi('oneliner.pcb');
end;
procedure read_data_file;
begin
assign(f,'data\oneliner.dat');
reset(f);
while not eof(f) do read(f,one);
gotoxy(4,4);
write(one.lineswap[1]);
gotoxy(4,5);
write(one.lineswap[2]);
gotoxy(4,6);
write(one.lineswap[3]);
gotoxy(4,7);
write(one.lineswap[4]);
gotoxy(4,8);
write(one.lineswap[5]);
gotoxy(4,9);
write(one.lineswap[6]);
gotoxy(4,10);
write(one.lineswap[7]);
gotoxy(4,11);
write(one.lineswap[8]);
gotoxy(4,12);
write(one.lineswap[9]);
gotoxy(4,13);
write(one.lineswap[10]);
gotoxy(4,14);
write(one.lineswap[11]);
gotoxy(4,15);
write(one.lineswap[12]);
close(f);
end;
procedure add_oneliner;
begin
i2 :=12;
textcolor(7);
textbackground(0);
gotoxy(2,21);
write('..%%> ');
one.lineswap[1] :=one.lineswap[2];
one.lineswap[2] :=one.lineswap[3];
one.lineswap[3] :=one.lineswap[4];
one.lineswap[4] :=one.lineswap[5];
one.lineswap[5] :=one.lineswap[6];
one.lineswap[6] :=one.lineswap[7];
one.lineswap[7] :=one.lineswap[8];
one.lineswap[8] :=one.lineswap[9];
one.lineswap[9] :=one.lineswap[10];
one.lineswap[10] :=one.lineswap[11];
one.lineswap[11] :=one.lineswap[12];
{readln(one.lineswap[12]);}
len:=67;
one.lineswap[12]:=strupper(lengthstring(len));
gotoxy(2,21);
write(' ');
assign(f,'data\oneliner.dat');
filemode:=2;
rewrite(f);
write(f,one);
close(f);
main_menu;
end;
procedure grab_info;
begin
end;
procedure menu;
var
first : integer;
begin
first:=58;
gotoxy(first,17);
textcolor(0);
textbackground(3);
write(options[1]);
option:=1;
grid_ref:=17;
repeat
choice:=readkey;
case choice of
#13 : if option=3 then begin
add_oneliner;
end else
if option=2 then begin
grab_info;
end else
if option=1 then begin
textcolor(7);
textbackground(0);
main_menu;
end;
#27 : halt;
#80 : begin
if option<3 then begin
gotoxy(first,grid_ref);
textbackground(0);
textcolor(7);
write(options[option]);
inc(grid_ref);
gotoxy(first,grid_ref);
textbackground(3);
textcolor(0);
writeln(options[option+1]);
option:=option+1;
end else begin
gotoxy(first,grid_ref);
textcolor(7);
textbackground(0);
write(options[3]);
grid_ref:=grid_ref-2;
gotoxy(first,grid_ref);
textbackground(3);
textcolor(0);
write(options[1]);
option:=option-2;
end;
end;
end;
cows_come_home:=false;
until cows_come_home;
end;
procedure one_liner_run;
begin
init_asc;
set_options;
read_data_file;
menu;
end;
end.