Lasso Soft Inc. > Home

[xs_sessionVars]

Linkxs_sessionVars
AuthorJonathan Guthrie
CategorySession
Version8.x
Licensehttp://creativecommons.org/licenses/by/2.5/
Posted08 Mar 2006
Updated08 Mar 2006
More by this author...

Description

Defines session vars from a supplied map and data type. A possible later extension would be to have separate datatypes per variable.

Sample Usage

local('varMap'=(Map:
	'sv_sessionvar1'='',
	'sv_sessionvar1'='',
));
xs_sessionVars(-varMap=#varMap,-sName=$sessionName);

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('xs_sessionVars',
			-Required='varMap',
			-Optional='dataType',
			-Required='sName',
			-Description='Defines session vars from a supplied map and data type');

	iterate(#varMap,(local('temp')));
		Session_AddVariable(-Name=#sName,(#temp->First));
		if((Variable_Defined(#temp->First))==False);
			select(local('dataType'));
				case('integer');
					var((#temp->First)=(integer:(#temp->Second)));
				case:'decimal';
					var((#temp->First)=(decimal:(#temp->Second)));
				case:'array';
					var((#temp->First)=(#temp->Second));
				case:'map';
					var((#temp->First)=(#temp->Second));
				case:'boolean';
					var((#temp->First)=(#temp->Second));
				case;
					var((#temp->First)=(string:(#temp->Second)));
			/select;
		/if;
	/iterate;
/define_tag;

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