Mwnci unzip() Function

Syntax

unzip(array)

Description

The unzip() function converts an array of zipped data into separate arrays within an array container.

Example

Names=[“Bob”, “Jim”, “Fred”, “Ted”]
Ages=[40,45,68,61,92]
Pets=[“Parrot”, “Goat”, “Cat”]
a=zip(Names, Ages, Pets)
println(“a=”, a)
b=unzip(a)
println(“b=”, b)
NewNames=b[0]
NewAges=b[1]
NewPets=b[2]
println(“NewNames=”, NewNames)
println(“NewPets=”, NewPets)
println(“NewAges=”, NewAges)

a=[[“Bob”, 40, “Parrot”], [“Jim”, 45, “Goat”], [“Fred”, 68, “Cat”]]
b=[[“Bob”, “Jim”, “Fred”], [40, 45, 68], [“Parrot”, “Goat”, “Cat”]]
NewNames=[“Bob”, “Jim”, “Fred”]
NewPets=[“Parrot”, “Goat”, “Cat”]
NewAges=[40, 45, 68]