[lp_lasso_version]

Description

Link: [lp_lasso_version]
Author: Bil Corry
Category: Utility
Version: 8.x
License: Public Domain
Posted: Dec. 03, 2005
Updated: Sep. 14, 2007
More by this author...
Returns the Lasso version, edition and platform in a single string.

-version will optionally return the version number expressed as a decimal value.  For example, LP8.0.3 would return 8.0003, LP8.1.3 would return 8.0103 and LP8.5.1 would return 8.0501

-compact will optionally return the version, edition and platform as a 6-character string.  For example, Lasso Standard Edition 8.5.4 (Win32) becomes SW8540 (for [S]tandard edition, [W]indows, v8.5.4.0)

Parameters

-version boolean, optional Optionally return the version expressed as a decimal value.
-compact boolean, optional Optionally return the version, edition and platform expressed as a 6-char string.

Sample Usage

lp_lasso_version; // Lasso Standard Edition 8.5.4 (Win32)

(lp_lasso_version: -version); // 8.0504

(lp_lasso_version: -compact); // SW8540
						

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[

define_tag:'lp_lasso_version',
	-description='Returns the Lasso version, edition and platform in a single string.',
	-priority='replace',
	-optional='version', // returns the version expressed as a decimal value
	-optional='compact'; // returns the Lasso version, edition and platform expressed as a 6-char string

	if: (local_defined:'version');
		local:'version_array' = (lasso_version: -lassoversion)->(split:'.');
		local:'return' = decimal;
		iterate: #version_array, local:'v';
			#return += (decimal: (decimal: #v) / (math_pow: 10, (loop_count - 1) * 2));			
		/iterate;
		return: #return;
	else: (local_defined:'compact');
		local:'return' = string;
		
		// edition
		if: (Lasso_Version: -LassoEdition)->(contains:'standard');
			#return += 'S';
		else: (Lasso_Version: -LassoEdition)->(contains:'developer');
			#return += 'D';
		else: (Lasso_Version: -LassoEdition)->(contains:'enterprise');
			#return += 'E';
		else;
			#return += 'U'; // unknown
		/if;

		// edition
		if: (Lasso_Version: -LassoPlatform)->(contains:'mac');
			#return += 'M';
		else: (Lasso_Version: -LassoPlatform)->(contains:'win');
			#return += 'W';
		else: (Lasso_Version: -LassoPlatform)->(contains:'lin');
			#return += 'L';
		else;
			#return += 'U'; // unknown
		/if;

		local:'version' = (string_findregexp:(Lasso_Version: -LassoVersion),-find='\\d')->(join:'');
		#version = (lp_string_pad: #version, 4, -padright, -padchar='0',-cropright);
		return: #return + #version;
	else;
		return: 'Lasso ' (Lasso_Version: -LassoEdition) ' ' (Lasso_Version: -LassoVersion) ' (' (Lasso_Version: -LassoPlatform) ')';
	/if;

/define_tag;

]

 

Comments

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net