comp.lang.ada
 help / color / mirror / Atom feed
* Strange error
@ 2015-01-22 21:46 Laurent
  2015-01-23  7:45 ` Egil H H
  0 siblings, 1 reply; 12+ messages in thread
From: Laurent @ 2015-01-22 21:46 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-01-26 21:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22 21:46 Strange error Laurent
2015-01-23  7:45 ` 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

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