Lasso Soft Inc. > Home


AuthorRandy Phillips
LicensePublic Domain
Posted25 Jun 2007
Updated13 Jul 2007
More by this author...


I created this  tag to bypass the "built in" error that occurs when the find->get element does not exist in a pair array. It gets values from pair arrays such as client_postparams or client_getparams without throwing an error when the element does not exist. Instead it silently returns a NULL value.

Sample Usage

local('fruit' = (array: 'item1' = 'apples', 'item2' = 'bananas', 'item1' = 'strawberries', 'item3' = 'oranges'));

(rp_param: -pairs=(#fruit), -find='item1');


(rp_param: -pairs=(#fruit), -find='item1', -instance=2);


(rp_param: -pairs=(#fruit), -find='item1', -instance=3);


(rp_param: -pairs=(#fruit), -find='item7');


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.

define_tag:'param', -namespace='rp_',
	-required='pairs', -type=array,
	!(local_defined:'instance') ? local('instance' = 1);
	!(local_defined:'value') ? local('value' = NULL);
	local('param_count' = #pairs->(find:#find)->size);
		local('value' = #instance <= (loop_count) ? #pairs->(find:#find)->(get:#instance)->value | NULL);
		return: #value;

Related Tags


25 Jun 2007, Johan Solve


Great, Randy!

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home



©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft