so as you can see I am trying to make a procedure to reverse a linked list, here is the code and the records of the list and the node, I am only obtaining the first number of the list and I think that it could be because pre is null and the head (Current) is pointing to null but I am not sure and I do not know how to solve this, thank you.
Type Node;
Type List is access Node;
Type Node is record
Info: Integer;
nx: List;
end record;
procedure reverselist (L: in out List) is
Current: List:=L ;
Pre: List:=null;
Next: List:=null;
begin
if Current.nx /= null then
while Current.nx /= null loop
Next:= Current.nx;
Current.nx:= Pre;
Pre:= Current;
Current:= Next;
end loop;
end if;
end reverselist;