August 05, 2008
List all Types in a Collection without duplicates This post is outdated
I'm trying to get a hyperlink list of all types within a collection. It seems this could be done by looping through all products, for each product create a link using its type only if it has a new type (thereby eliminating a single type being repeated once or more). The question is, how do I do that? One approach is to create an array that would hold all the types that have appeared in the collection at any given iteration, and compare the current iteration (product type) against all types in the array. Can you create arrays? If you can't you could probably put all types in a string variable while separating each type with a special character like an underscore. Then you would need to access the String objects indexOf and subStr methods, do those exist? This is all I have so far that successfully outputs a list of types each as a hyperlink for a single collection.