Error 152
Publicado por Raul Gonzalez (4 intervenciones) el 27/06/2011 14:58:50
Buenos dias estoy haciendo un trabajo practico y ya lo termine el problema es que al ejecutarlo me tira el error 152, a que se puede dever, me pueden ayudar. Gracias
program parte1;
uses wincrt, crt; //accediendo a la biblioteca de windows para visualizar en pantalla... creo
type
tr_libros = record //creando el registro
ISBN: string [20];
titulo: char;
year: String [10]; // año del libro (no me deja escribir la "ñ")
cantvend: integer;
precio: real;
end; // finalizando el registro
tf_archlib= file of tr_libros; //asignando el registro a un archivo
var //generando las variables
vr_libros: tr_libros;
vf_archlib : tf_archlib;
va_opcion: char;
BEGIN
clrscr; // limpiando pantalla
assign (vf_archlib,'d:\libreria.dat'); {crea en el disco D el archivo 'libreria.dat'}
REWRITE(vf_archlib);
SEEK(vf_archlib,filesize(vf_archlib)); // moviendo apuntador al final del archivo existente
WRITELN('Deseas cargar los datos de un alumno? (s/n)');
READLN(va_opcion);
WHILE (va_opcion <> 'n') or (va_opcion <> 'N') DO
BEGIN // capturando registro
WRITE('Ingrese ISBN : ');
READLN(vr_libros.ISBN);
WRITE('Ingrese Título de la obra : ');
READLN(vr_libros.titulo);
WRITE('Ingrese Año de edición : ');
READLN(vr_libros.year);
WRITE('Ingrese cantidad vendida por título de la obra : ');
READLN(vr_libros.cantvend);
WRITE('Ingrese precio del libro : ');
READLN(vr_libros.precio);
WRITE(vf_archlib, vr_libros); // grabando el registro al archivo
WRITELN('NUEVO REGISTRO INSERTADO');
WRITELN;
WRITELN('Deseas cargar los datos de un libro mas? (s/n)');
READLN(va_opcion);
END;
CLOSE(vf_archlib); // cerrando archivo y avisando
WRITELN('ARCHIVO CERRADO');
READLN;
END.
program parte1;
uses wincrt, crt; //accediendo a la biblioteca de windows para visualizar en pantalla... creo
type
tr_libros = record //creando el registro
ISBN: string [20];
titulo: char;
year: String [10]; // año del libro (no me deja escribir la "ñ")
cantvend: integer;
precio: real;
end; // finalizando el registro
tf_archlib= file of tr_libros; //asignando el registro a un archivo
var //generando las variables
vr_libros: tr_libros;
vf_archlib : tf_archlib;
va_opcion: char;
BEGIN
clrscr; // limpiando pantalla
assign (vf_archlib,'d:\libreria.dat'); {crea en el disco D el archivo 'libreria.dat'}
REWRITE(vf_archlib);
SEEK(vf_archlib,filesize(vf_archlib)); // moviendo apuntador al final del archivo existente
WRITELN('Deseas cargar los datos de un alumno? (s/n)');
READLN(va_opcion);
WHILE (va_opcion <> 'n') or (va_opcion <> 'N') DO
BEGIN // capturando registro
WRITE('Ingrese ISBN : ');
READLN(vr_libros.ISBN);
WRITE('Ingrese Título de la obra : ');
READLN(vr_libros.titulo);
WRITE('Ingrese Año de edición : ');
READLN(vr_libros.year);
WRITE('Ingrese cantidad vendida por título de la obra : ');
READLN(vr_libros.cantvend);
WRITE('Ingrese precio del libro : ');
READLN(vr_libros.precio);
WRITE(vf_archlib, vr_libros); // grabando el registro al archivo
WRITELN('NUEVO REGISTRO INSERTADO');
WRITELN;
WRITELN('Deseas cargar los datos de un libro mas? (s/n)');
READLN(va_opcion);
END;
CLOSE(vf_archlib); // cerrando archivo y avisando
WRITELN('ARCHIVO CERRADO');
READLN;
END.
Valora esta pregunta


0