comp.lang.ada
 help / color / mirror / Atom feed
From: Laurent <daemon2@internet.lu>
Subject: Strange error
Date: Thu, 22 Jan 2015 13:46:09 -0800 (PST)
Date: 2015-01-22T13:46:09-08:00	[thread overview]
Message-ID: <713608f7-d46e-4b73-a34e-552d1b978d2c@googlegroups.com> (raw)

Hi

I have a strange error with my double linked list, more precisely my reverse_print procedure:

...

Content of L2 (Target) after copying L1 (Source)
Huh. . .Top. . .taa. . .Hat. . .Boy. . .Cat. . .Tut. . .Gna. . .

Content of L2 (Target) after copying L1 (Source), reverse print
Gna. . .Tut. . .Cat. . .Boy. . .Hat. . .taa. . .Top. . .Huh. . .

Content of L2 (Target) after deleting it
List is empty

Content of L3
List is empty

inserting 5000 in L3
Content of L3, normal display
5000. . .
Content of L3, reverse display
5000. . .

inserting 123 in L3
Content of L3, normal display
123. . .5000. . .
Content of L3, reverse display
5000. . .123. . .

inserting 4567 in L3
Content of L3, normal display
123. . .4567. . .5000. . .
Content of L3, reverse display
5000. . .123. . . 

[2015-01-22 22:25:49] process terminated successfully, elapsed time: 00.21s

The version to test the reverse print on L2 which is a list of 3 char silly words works as expected.

The version to test it with integers doesn't. Stops after 2 elements even if there are more in the list.

The files are on git.

https://github.com/Chutulu/Chapter-15.git

No idea what is going wrong. The worst is that before it worked. I had put both versions inside one procedure with an additional parameter to decide if normal print or reverse. wasn't happy with the choice thing and decided to make 2 /= procedures.

Thanks

Laurent


             reply	other threads:[~2015-01-22 21:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 21:46 Laurent [this message]
2015-01-23  7:45 ` Strange error Egil H H
2015-01-23  8:44   ` Laurent
2015-01-23 20:45     ` Laurent
2015-01-23 21:26     ` Randy Brukardt
2015-01-24  1:34       ` Bob Duff
2015-01-24 13:14         ` Brad Moore
2015-01-24 19:12           ` Laurent
2015-01-26 21:44         ` Randy Brukardt
2015-01-24  0:47     ` Bob Duff
2015-01-24 19:08       ` Laurent
2015-01-25  9:25     ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox