Lasso Soft Inc. > Home


AuthorBil Corry
LicensePublic Domain
Posted07 Dec 2005
Updated07 Dec 2005
More by this author...


Returns a string of random alphanumeric characters.  May specify length, default is 20 characters.

Sample Usage

var:'size' = 50;
'lp_string_random Example\r\n';
'Length = '$size'\r\n';
'+' * $size '\r\n';
loop: 50;
	(lp_string_random: $size) '\r\n';
'+' * $size '\r\n';

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 a string of random alphanumeric characters.',

	// based on a tag by Greg Willits

	local:'alphanumeric' = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';

	if: !(local_defined:'length');
		local:'length' = 20;

	local:'lp_string_random' = string;
		#lp_string_random += #alphanumeric->(get:(integer:(math_random: -lower=1, -upper=62)));
	return: #lp_string_random;




24 Jun 2014, Steve Piercy

Lasso 9 version on GitHub

I've released a Lasso 9 version of this method at GitHub

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