This is a subclassed array which will not add duplicate items. Useful in situations where the order of insertion is important, and thus using a [set] is not an option. Otherwise, works identically to a standard array.
Parameters
none
Sample Usage
var('test') = array_unique('a','b','c');
$test->insert('a'); // will not be inserted
$test->insert('m'=1); // also works with pairs
$test->insert('m'=2); // same key inserts because value is different
$test->insertfirst('m'=2); // true duplicate does not insert
$test->insert('d');
$test->insertfirst('b'); // will not be inserted
$test->insertfirst('z');
$test->insertlast('c'); // will not be inserted
$test->insertlast('e');
var('more') = array('f','g','h','x','y','z');
$test->insertfrom($more->iterator); // will not (re)insert z
$test; // returns a standard array: z,a,b,c,m=1,m=2,d,e,f,g,h,x,y
// iteration, etc. works as expected.
iterate($test, local('i'));
#i + '<br />\n';
/iterate;
Source Code
Click the "Download" button below to retrieve a copy of this tag,
including the complete documentation and sample usage shown
on this page. Place the downloaded ".inc" file in your
LassoStartup folder, restart Lasso, and you can begin using this
tag immediately.