Pascal - vytvoření html tagů pro tabulky.

Kategorie >>Programování>> Pascal - vytvoření html tagů pro tabulky.


{Tak sem si chvili hral v pascalu a vysledkem je program, co nam z nakopirovanych radku udela tabulku, nekontroluje to mraky veci, ale
tak nejak na ukazku to snad staci DaveM}

uses crt,dos;
const
rozdel=' ';
table1='

'; table2='
';
tr1='';
tr2='';
td1='';
td2='';

var
f1:file;
f2:file;
s1,s2:string;

i:byte;
l:longint;
ch:char;
s:string;
tts:byte;as:string;ach:char;pom_b:byte;

procedure write_s(var fle:file;co:string);
var ibt:byte;
begin
for ibt:=1 to length(co) do blockwrite(fle,co[ibt],1);
end;

procedure write_eoln(var fle:file);
VAR BT:BYTE;
begin
bt:=13;blockwrite(fle,bt,1);
bt:=10; blockwrite(fle,bt,1);
end;




begin
HighVideo;

for i:=0 to 5 do writeln; {odradkovani}
writeln(' **** Qex Soft (c), 1995 - 2007 ****');
writeln(' Programmed by David MizerObrázeka');
writeln;
textcolor(14);

if paramcount>0 then begin
s1:= paramstr(1);
s2:= '0'+paramstr(1);
writeln('Vstupni soubor :',s1);
writeln('Vystup. soubor :',s2);
writeln;
IF PARAMCOUNT=0 then begin
writeln(' Neni zadanej nazev vstupniho souboru');
writeln(' Spusti znovu exe soubor s prislusnym parametrem');
writeln(' jako : table_w.exe d:terminator.txt');
end

else begin
assign(f1,s1);
assign(f2,s2);
{$i-}
reset(f1,1);
{$i+}
if ioresult0 then
writeln('chyba prace se souborem, asi ti neexistuje >', ioresult)
else begin
rewrite(f2,1);
clrscr;

as:='';

write_s(f2,table1);
write_eoln(f2);


write_s(f2,tr1);{napisu }
repeat

repeat
blockread(f1,ach,1);
if (achrozdel)and(ach#13) then as:=as+ach;
until (ach=rozdel)or (eof(f1)=true)or(ach=#13);{#13#10 = end of line..enter}

{najde mezeru .. ukonceni sloupce}
if ach=rozdel then begin write_s(f2,td1);write_s(f2,as);write_s(f2,td2);
end; { blabla }

if ach=#13 then begin
blockread(f1,ach,1);{prectu jeste #10}
write_s(f2,as);{zapisu precteny slovo}
write_s(f2,tr2); {ukoncim }
write_eoln(f2); {pekne si to vodradkuju}
if filepos(f1)




Vloženo: 20.06.2007 17:26
Přečteno:2787
Autor: David Mizera

Hlasů: 2 Hodnocení(jako ve škole): 2
 

Komentáře (0)

   -     Nový Komentář