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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,acad772db703a890 X-Google-Attributes: gid103376,public From: ucaa2385@alpha1.csv.ica.uni-stuttgart.de (Peter Hermann) Subject: Re: Simple Pointer Problem, Help... Date: 1996/05/24 Message-ID: <4o3vqj$3sgu@info4.rus.uni-stuttgart.de>#1/1 X-Deja-AN: 156491650 references: <4o2vu9$hdc@catapult.gatech.edu> organization: Comp.Center (RUS), U of Stuttgart, FRG newsgroups: comp.lang.ada Date: 1996-05-24T00:00:00+00:00 List-Id: Daniel J (gt7693d@acmex.gatech.edu) wrote: >To any friendly programmer, this sounds like "to a friendly Ada-Teamer" ;-) so I give it a try :-) > procedure AddNodeBack (Point : in out NumPtr; > Value : in Integer) is p : numptr := point; > begin if p=null then Point := new NumRecord'(Value, null); else while P.next /= null loop P := P.Next; end loop; P.next := new NumRecord'(Value, null); end if; > > end AddNodeBack; > The output of the body gives me one node, which is not what I want. true ;-) >I desire a linked list of N nodes w/values in ascending order, according to you have indeed produced a linked list but you can't reach it ;-) The original pointer is ultimately destroyed in your original code :-( Caution: the above piece of suggested code is not tested, i.e. it is certainly wrong... as it is usual for the first trial ;-) Daniel, it is your turn now to test and give me the correct solution with all mumble-dee-bumble around (I need a lot of working examples for my text-booklet). -- Peter Hermann Tel:+49-711-685-3611 Fax:3758 ph@csv.ica.uni-stuttgart.de Pfaffenwaldring 27, 70569 Stuttgart Uni Computeranwendungen Team Ada: "C'mon people let the world begin" (Paul McCartney)