Lasso Soft Inc. > Home

[client_param_9]

Linkclient_param_9
AuthorJolle Carlestam
CategoryClient
Version9.x
LicensePublic Domain
Posted13 Oct 2009
Updated13 Oct 2009
More by this author...

Description

A replacement for action_param. Retains its value even when used inside inlines. Returns the value of a client GET/POST parameter Inspired by Bil Corrys lp_client_param Requires the tag client_params. (On Tagswap called client_params_9.)

Sample Usage

client_param('my');
client_param('my', 2);
client_param('my', 'get');
client_param('my', 2, 'post');
client_param('my', -count);
client_param('my', 'get', -count);

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.

 {
	return client_param(#param, -1, '', -count=#count);
}
define client_param(param::string, method::string, -count::boolean = false) => {
	return client_param(#param, -1, #method, -count=#count);
}
define client_param(param::string, index::integer, method::string = '', -count::boolean = false) => {

	local(output) = array;

	client_params(#method) -> foreach => {
		(#1 -> type == 'pair' && #param == #1 -> name) ?
			#output -> insert(#1 -> value);
	}

	#count ? return #output -> size;

	#index <= 0 ? return #output -> join('\r');

	#index > 0 && #output -> size >= #index ? return #output -> get(#index);

	return string;
}

?>

Related Tags

Comments

No comments

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