[xs_sessionVars]
Description
Defines session vars from a supplied map and data type.
A possible later extension would be to have separate datatypes per variable.
Parameters
-varMap
map, required
map of vars to be added plus the initial value
-sName
string, required
Session id
-dataType
string, optional
the default datatype for all session vars in this tag
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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
none
Newest
Most Popular