procedimiento next
Publicado por miguel (1 intervención) el 17/01/2017 17:58:25
Hola, estoy intentando hacer un procedimiento next que me imprima el siguiente elemento en una tabla hash con resoluciones de colision mediante encadenamiento, y en mi código me da un access check failed en el primer exit y no sé por qué.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
type Cursor is record
M : Map;
Element_A : Cell_A;
Position : Integer; --recorre posición array
end record;
procedure Next (C: in out Cursor) is
-- trabajar con c.position en vez de pos
begin
loop
if C.M.Tabla(C.Position) /= null then
loop
if C.M.Tabla(C.Position).Next /= null then
C.Element_A := C.Element_A;
else
C.Position := C.Position + 1;
end if;
--116 exit when C.M.Tabla(C.Position).Next = null;
end loop;
else
C.Position := C.Position + 1;
end if;
exit when C.Position = Max_Activos or C.M.Tabla(C.Position).Next /= null;
end loop;
end Next;
Valora esta pregunta
0