home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
library
/
dos
/
vi_si_on
/
promptfx.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-04-02
|
5KB
|
210 lines
{$i-}
uses crt,dos;
type
ca=array[1..19] of byte; const arr:ca=($53,$67,$64,$1F,$49,$6E,$6B,$6B,
$78,$1F,$40,$6D,$60,$71,$62,$67,$68,$72,$73);
var
s:string;k:char;t:text;b:byte;
prompt:array[1..3] of string[80];
carr:ca;
liner:integer;done:boolean;
Z:integer;
function yes:boolean;
begin
repeat
k:=#0;
k:=upcase(readkey);
until k in ['Y','N'];
if k = 'Y' then yes:=true else yes:=false;
if k = 'Y' then write('Yes') else write('No');
end;
procedure center(c,y:byte;s:string);
var b:byte;
begin
b:=round((80-length(s))/2);
textcolor(c);
gotoxy(b,y);
write(s);
end;
procedure k_elite;
begin
s:='─';
for b:=1 to 12 do begin
s:=s+'──';
delay(100);
center(7,1,s);
center(7,4,s);
end;
end;
procedure write_time;
var hour,minute,second,sec100:word;am:boolean;
begin
gettime(hour,minute,second,sec100);
if hour<10 then write('0');
am:=true;
if hour>12 then
begin
am:=false;
hour:=hour-12;
end;
write(hour);
write(':');
if minute<10 then write('0');
write(minute);
if am then write('am') else write('pm');
end;
procedure prompt_write(s:string);
var i:integer;s2:string[2];
begin
i:=1;
if length(s)<1 then begin
exit;
end;
repeat
if s[i]='|' then begin
s2:=copy(s,i+1,2);
if s2 = '01' then textcolor(01) else
if s2 = '02' then textcolor(02) else
if s2 = '03' then textcolor(03) else
if s2 = '04' then textcolor(04) else
if s2 = '05' then textcolor(05) else
if s2 = '06' then textcolor(06) else
if s2 = '07' then textcolor(07) else
if s2 = '08' then textcolor(08) else
if s2 = '09' then textcolor(09) else
if s2 = '10' then textcolor(10) else
if s2 = '11' then textcolor(11) else
if s2 = '12' then textcolor(12) else
if s2 = '13' then textcolor(13) else
if s2 = '14' then textcolor(14) else
if s2 = '15' then textcolor(15) else
if s2 = 'RC' then textcolor(9) else
if s2 = 'PC' then textcolor(10) else
if s2 = 'SC' then textcolor(11) else
if s2 = 'IC' then textcolor(12) else
if s2 = 'CR' then WriteLn;
if s2 = 'TL' then Write('60');
if s2 = 'TN' then write_time else
if s2 = 'CA' then write('Main') else
if s2 = 'UH' then write('Crimson Blade'); (* else write('|'+s2); *)
i:=i+3;
end else begin
write(s[i]);
inc(i);
end;
until i > length(s);
writeln;
end;
procedure cw(b:byte;s:string);
begin
textcolor(b);
write(s);
end;
procedure line(x1,x2,y:integer);
begin
gotoxy(x1,y);
for y:=1 to (1+x2-x1) do
write('─');
end;
var si:string;
begin
repeat
textbackground(0);
clrscr;
carr:=arr;
si:=chr($42)+chr($79)+chr($3A)+chr($20);
textattr:=8; Line(1,80,1);
textattr:=10; WriteLn('ViSiON Prompt Customizer');
textattr:=14; WriteLn('Written By: Crimson Blade and The Elemental');
textattr:=12; WriteLn('A Ruthless Enterprises Production (c) 1991');
textattr:=8; Line(1,80,5);
delay(200);
assign(t,'PROMPT.DAT');
{$I-}reset(t);{$I+}
if ioresult<>0 then begin
rewrite(t);
close(t);
append(t);
writeln(t,'|07|CA |12[|09?/help|12]|15:|13');
writeln(t);
writeln(t);
end;
close(t);
reset(t);
readln(t,prompt[1]);
readln(t,prompt[2]);
readln(t,prompt[3]);
close(t);
textattr:=9;
writeln;
write('Current Prompt');
textattr:=3;
WriteLn('...');
WriteLn;
prompt_write(prompt[1]);
prompt_write(prompt[2]);
prompt_write(prompt[3]);
textattr:=12;
WriteLn;
Write('Creat a new prompt');
textattr:=4;
write('? ');
textcolor(3);
if not(yes) then Begin ClrScr; halt; End;
delay(200);
ClrScr;
textattr:=8; line(1,80,1);
textattr:=14;
WriteLn(' |CA Current Place |UH User Handle |TL Time Left |TN Time Now |CR Carriage');
WriteLn('|01-|15 Ansi Colors 1-15 |RC User Regular |SC Status |PC Prompt |IC Input Colors');
textattr:=8; line(1,80,4);
WriteLn;
cw(9,' Enter a ');
cw(12,'NEW ');
cw(9,'prompt. Press ');
cw(13,'ENTER ');
cw(9,'on a ');
cw(12,'BLANK ');
cw(9,'line when done.');
textattr:=1;
line(1,80,7);
liner:=0;
done:=false;
for liner:=1 to 3 do prompt[liner]:='';
for liner:=1 to 3 do begin
if done=false then begin
cw(3,(chr(ord('0')+liner)+':'));
readln(prompt[liner]);
if (prompt[liner] = '') or (liner=3) then done:=true;
end;
end;
WriteLn;
for liner:=1 to 3 do begin
if prompt[liner]<>'' then prompt_write(prompt[liner]);
end;
WriteLn;
cw(5,'Save this? ');
textcolor(3);
if yes then begin
writeln;
rewrite(t);
close(t);
append(t);
writeln(t,prompt[1]);
writeln(t,prompt[2]);
writeln(t,prompt[3]);
close(t);
writeln;
cw(3,'Thanks for choosing ViSiON!');
writeln;
end;
until true=false;
end.