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

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
User avatar
Tuxedo
Posts: 355
Joined: Sun Feb 14, 2010 12:41 pm

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

Post 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?
Simone"Tuxedo"Monsignori, Perugia, ITALY.
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post 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.
User avatar
Tuxedo
Posts: 355
Joined: Sun Feb 14, 2010 12:41 pm

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

Post 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!
Simone"Tuxedo"Monsignori, Perugia, ITALY.
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post 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 :-)
Locked