Lasso Soft Inc. > Home


AuthorBil Corry
LicensePublic Domain
Posted03 Dec 2005
Updated14 Sep 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)

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.


	-description='Returns the Lasso version, edition and platform in a single string.',
	-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));			
		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';
			#return += 'U'; // unknown

		// 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';
			#return += 'U'; // unknown

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




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