Localize file www.TrSek.com/cover/svejcar/wmaster.pas{ WMASTER.PAS Copyright (c) Vaclav Svejcar }
{ Software by VS International 2006 }
{ Toto je program slouzici jako textovy editor. }
{ vsinternational@volny.cz }
{ }
{ Datum:13.06.2006 http://www.trsek.com }
program WriteMaster;
uses crt,dos,trsek;
var l,t,d:text;
st,su,sd:string;
ch:char;
a:real;
vyber:real;
v:char;
b:real;
c:real;
z:char;
q:char;
k:real;
procedure hlavni;
begin
clrscr;
textcolor(14);
textbackground(1);
writeln('WriteMaster 1.0 Verze CZ (c)VS International 2006 ');
textbackground(0);
writeln('Stiskni cislo moznosi a potvrd ENTEREM ');
writeln('Napoveda <1> | Nacist soubor <2> | Vytvorit soubor <3> | Dopsat soubor <4>');
writeln('Konec <5>');
writeln('__________________________________________________________________________');
writeln;
textcolor(15);
readln(vyber);
if vyber>5 then begin
gotoxy(32,12);
textcolor(4);
writeln('Error 1:NESPRAVNY PRIKAZ');
readln;
end;
if vyber<1 then begin
gotoxy(32,12);
textcolor(4);
writeln('Error 1:NESPRAVNY PRIKAZ');
readln;
end;
if vyber=1 then begin {napoveda}
clrscr;
textcolor(14);
writeln('ÉÍÍÍÍÍÍNAPOVEDA PRO WriteMaster 1.0ÍÍÍÍÍÍ»');
writeln('º________________________________________º');
writeln('º O PROGRAMU º');
writeln('º Tento program je editor textovych º');
writeln('º souboru (*.txt). Pri spusteni mate tytoº');
writeln('º moznosti: º');
writeln('º________________________________________º');
writeln('º NAPOVEDA º');
writeln('º Stisknete 1 a potvrdte ENTERem. Spusti º');
writeln('º se tato napoveda, kterou ukoncite º');
writeln('º stiskem ENTERU. º');
writeln('º________________________________________º');
writeln('º NACIST SOUBOR º');
writeln('º Stisknete 2 a potvrdite ENTERem. Pote º');
writeln('º stisknete dle vyberu. Ukoncite ENTERem.º');
writeln('º________________________________________º');
writeln('º VYTVORIT SOUBOR º');
writeln('º Stisknete 3 a potvrdte ENTERem. Pote º');
writeln('º pokracujte podle prikazu. Ukoncite º');
writeln('º ENTERem. º');
writeln('º________________________________________º');
writeln('º~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~º');
writeln('º Dotazy piste na vsvejcar@volny.cz º');
writeln('ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ');
readln;
hlavni;
end;
if vyber=2 then begin
clrscr;
textcolor(4);
writeln('POZOR!! Program cte soubory pojmenovane soubor.txt, ktere');
writeln('musi byt ve stejnem adresari (slozce) jako tento program.');
writeln('Pokud program nenalezne soubor soubor.txt, bude ukoncen.');
writeln;
textcolor(15);
writeln('Stisknete moznost a potvrdte ENTERem.');
writeln;
writeln('Opravdu chcete otevrit soubor.txt? (a/n)');
readln(v);
if v='a' then
begin
clrscr;
assign(l,'soubor.txt');
reset(l);
readln(l,st);
close(l);
gotoxy(3,4);textcolor(15);writeln(' text:',st);
reset(l);
gotoxy(3,2);textcolor(14);writeln('Pro konec stisknete 5 a ENTER');
writeln('______________________________________');
readln(b);
if b=5 then begin
close(l);
clrscr;
hlavni;
end;
end;
if v='n' then begin
clrscr;
hlavni;
end;
end;
if vyber=3 then begin
clrscr;
textcolor(4);
writeln('POZOR! Pro preskoceni na dalsi');
writeln(' radek v textu dojedte na misto MEZERNIKem, nikdy ENTERem.');
writeln('ENTERem zobrazite ukladaci menu.');
writeln('Program ma omezenou pamet textu, proto vyuzijte pripadne funkci');
writeln('DOPSAT SOUBOR.');
textcolor(15);
writeln('Stisknete moznost a potvrdte ENTERem.');
writeln;
writeln('Opravdu chcete pokracovat? (a/n)');
readln(z);
if z='a' then begin
clrscr;
gotoxy(1,1);textcolor(14);
writeln('Napiste text, ktery chctes zapsat do souboru(soubor.txt):');
writeln('_________________________________________________________');textcolor(15);
readln(su);
writeln;
writeln('Pro zapsani stisknete 2, pro konec 5 a potvrdte ENTERem.');
readln(c);
if c=2 then begin
assign(t,'soubor.txt');
rewrite(t);
write(t,su);
close(t);
clrscr;
textcolor(14);
writeln('Text byl zapsan do souboru soubor.txt');
writeln('Stiskni ENTER');
readln;
hlavni;
end;
if c=5 then begin
clrscr;
hlavni;
end;
end;
if z='n' then begin
clrscr;
hlavni;
end;
end;
if vyber=4 then begin
clrscr;
textcolor(4);
writeln('Tato funkce umozni dopsat textovy soubor (soubor.txt).');
writeln;
textcolor(15);
writeln('Stisknete moznost a potvrdte ENTERem.');
writeln;
writeln('Opravdu chcete pokracovat? (a/n)');
readln(q);
if q='a' then begin
clrscr;
textcolor(14);
writeln('Zde napiste text na dopsani souboru a potvrdte ENTERem:');
writeln('_______________________________________________________');
writeln;
textcolor(15);
assign(d,'soubor.txt');
readln(sd);
writeln;
textcolor(15);
writeln('Pro zapsani stisknete 2, pro konec 5 a potvrdte ENTERem.');
readln(k);
if k=2 then begin
append(d);
write(d,sd);
close(d);
clrscr;
textcolor(14);
writeln('Text byl uspesne dopsan. Stisknete ENTER.');
readln;
hlavni;
end;
if k=5 then begin
clrscr;
hlavni;
end;
end;
if q='n' then begin
clrscr;
hlavni;
end;
end;
if vyber=5 then begin
textcolor(15);
writeln('Ukoncuji... Stiskni ENTER');
readln;
end;
end;