como codificar un archivo
Publicado por GONZALO (1 intervención) el 30/09/2010 03:22:55
hola a todos! estoy aprendiendo algoritmos y a codificar en pascal
resulta que no me compila este programa, agradeceria que me ayuden, gracias
program 1;
type
treg = record
nombre: string[20];
categoria: char;
end;
tarch = file of treg;
var
a: string [2];
nom: string [20];
cat: char;
z: treg;
w: tarch;
begin
assign (w,'archivo.dat');
rewrite (w);
writeln ('Desea empezar, si/no');
readln (a);
while (a = 'si') do
begin
writeln ('ingrese nombre y categoria');
readln (nom, cat);
z.nombre:=nom;
z.categoria:=cat;
write (w,z);
writeln ('desea continuar? si/no');
readln (a);
end;
close(w);
end.
resulta que no me compila este programa, agradeceria que me ayuden, gracias
program 1;
type
treg = record
nombre: string[20];
categoria: char;
end;
tarch = file of treg;
var
a: string [2];
nom: string [20];
cat: char;
z: treg;
w: tarch;
begin
assign (w,'archivo.dat');
rewrite (w);
writeln ('Desea empezar, si/no');
readln (a);
while (a = 'si') do
begin
writeln ('ingrese nombre y categoria');
readln (nom, cat);
z.nombre:=nom;
z.categoria:=cat;
write (w,z);
writeln ('desea continuar? si/no');
readln (a);
end;
close(w);
end.
Valora esta pregunta


0