Page 1 of 1

[07 Oct 2010] Unpack way of work or bug ???

Posted: Sat Jun 13, 2020 5:32 pm
by Tuxedo
Note: This is an archived post that was originally sent to the Hollywood mailing list on 07 Oct 2010 00:04:50 +0200

Hi ALL! I noticed that Unpack() function stops "unpacking" when it found a Nil value.. So Tables with some Nil spaces wasnt displayed correctly but only for the first n-fields that wasnt the first Nil that stops the output...

For example:

Code: Select all

foo = {1, 5, 7 , 8, Nil, 56, 78, 43, 5, 6, Nil, 467, 34, 56, 897, 34}
DebugPrint(Unpack(foo))
outputs:

1 5 7 8

and not show the other values... On the guide no reference to that behaviour so I think that was a bug... I'm wrong?

[15 Oct 2010] Re: Unpack way of work or bug ???

Posted: Sat Jun 13, 2020 5:32 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 15 Oct 2010 21:11:25 +0200
On the guide no reference to that behaviour so I think that was a bug... I'm wrong?
No, it's not a bug, it's a feature :) The current implementation will stop unpacking when it finds a Nil element. Maybe I should add this to the documentation.

[15 Oct 2010] Re: Unpack way of work or bug ???

Posted: Sat Jun 13, 2020 5:32 pm
by Tuxedo
Note: This is an archived post that was originally sent to the Hollywood mailing list on 15 Oct 2010 21:39:48 +0200

Ciao Andreas, Ok! But if some one needs to unpack a table with "Nil" spaces? Only with a custom routine?

GOOD WORK!

[17 Oct 2010] Re: Re: Unpack way of work or bug ???

Posted: Sat Jun 13, 2020 5:32 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 17 Oct 2010 14:30:51 +0200
Ciao Andreas, Ok! But if some one needs to unpack a table with "Nil" spaces? Only with a custom routine?
Yes, you've to use a custom routine :-)