Article View: comp.lang.pascal.borland
Article #660LISTAS GENERICAS EN PASCAL
From: ANGEL CEPA
Date: Sat, 06 Jan 2001 15:07
Date: Sat, 06 Jan 2001 15:07
45 lines
2171 bytes
2171 bytes
Necesito q alguien me ayude y me pase el codigo de un objeto lista generica
en pascal parecida a esta:
TPuntero=^nodo;
nodo=RECORD
info:pointer;
sig:TPuntero;
END;
TLista=OBJECT
PRIVATE
primero,ultimo:TPuntero;
espacio:integer;
PUBLIC
CONSTRUCTOR Inicializar(espacio:integer);
PROCEDURE Insertar(VAR direccion:pointer);
PROCEDURE Sacar(VAR direccion:pointer);
PROCEDURE Actual(VAR direccion:pointer);
PROCEDURE Siguiente(VAR direccion:pointer);
FUNCTION Vacia:boolean;
DESTRUCTOR Liberar;
END;
He hecho un codigo con este objeto y no me da errores de compilacion, sino q
me da errores de acceso a memoria en tiempo de ejecucion. Posiblemente sea x
la manera en la q llamo al los procedimientos de Insertar, Sacar, Actual o
siguiente. Esto es lo q hago:
VAR datos:TLista;
.....
FUNCTION Sacar:char;
VAR
x:char;
p,q:pointer;
BEGIN
datos.sacar(p);
q:=@x;
move(p,q,sizeof(char));
Sacar:=x;
END;
......
Me ayudaria mucho ver el codigo completo de un objeto lista generica como
esta. Se q es un problema un poco extra�o pero es q es la 1� vez q me tengo
q pegar con una lista generica y no tengo ni idea de como hacerlo. Muchas
gracias.
Technical Details
Message-ID:
<3a57348b$1@news>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!134.222.94.5!npeer.kpnqwest.net!news!212.73.59.125Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: 10d088,d73e5ab0c7518546,start X-Google-Attributes: gid10d088,public X-Google-Thread: 111659,d73e5ab0c7518546,start X-Google-Attributes: gid111659,public X-Google-ArrivalTime: 2001-01-06 07:06:53 PST From: "ANGEL CEPA" <ancepan@navegalia.com> Newsgroups: comp.lang.pascal.borland,es.comp.os.ms-windows.programacion Subject: LISTAS GENERICAS EN PASCAL Date: Sat, 6 Jan 2001 16:07:07 +0100 Lines: 47 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 NNTP-Posting-Host: 212.73.59.125 X-Original-NNTP-Posting-Host: 212.73.59.125 Message-ID: <3a57348b$1@news> X-Trace: 6 Jan 2001 16:06:51 +0100, 212.73.59.125 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!134.222.94.5!npeer.kpnqwest.net!news!212.73.59.125