From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_50,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,acad772db703a890,start X-Google-Attributes: gid103376,public From: gt7693d@acmex.gatech.edu (Daniel J) Subject: Simple Pointer Problem, Help... Date: 1996/05/24 Message-ID: <4o2vu9$hdc@catapult.gatech.edu>#1/1 X-Deja-AN: 156415049 organization: Georgia Institute of Technology newsgroups: comp.lang.ada Date: 1996-05-24T00:00:00+00:00 List-Id: To any friendly programmer, Take a look at this code and read the comments at end, they seem self explanatory. --Types and declarations type NumRecord; type NumPtr is access NumRecord; type NumRecord is record Value : Integer; Next : NumPtr; end record; Num : NumPtr; --Modules --Purpose: Add a node to the end of a linked list procedure AddNodeBack (Point : in out NumPtr; Value : in Integer) is begin if Point /= null then while Point /= null loop Point := Point.Next; end loop; Point := new NumRecord'(Value, null); else Point := new NumRecord'(Value, null); end if; end AddNodeBack; --Body Num := new NumRecord'(0, null); for I in 1..10 loop AddNodeBack (Num, I); end loop; The output of the body gives me one node, which is not what I want. I desire a linked list of N nodes w/values in ascending order, according to my body. What am I doing wrong, for I've run outta ideas? ps I've tried to use a temp pointer within AddNodeBack, but got the same output. _____________________________________________________________________________ Daniel J. Feren | 327693 GA Tech Station | GTRI/ELSYS/SEN Atlanta, Georgia 30332 | Co-Op Win/Sum __________________________________|__________________________________________ Email: gt7693d@prism.gatech.edu Homepage: http://www.prism.gatech.edu/~gt7693d