Link | lp_string_random |
Author | Bil Corry |
Category | String |
Version | 8.x |
License | Public Domain |
Posted | 07 Dec 2005 |
Updated | 07 Dec 2005 |
More by this author... |
Returns a string of random alphanumeric characters. May specify length, default is 20 characters.
var:'size' = 50; ''; 'lp_string_random Example\r\n'; 'Length = '$size'\r\n'; '+' * $size '\r\n'; loop: 50; (lp_string_random: $size) '\r\n'; /loop; '+' * $size '\r\n'; '';
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:'lp_string_random', -description='Returns a string of random alphanumeric characters.', -priority='replace', -optional='length'; // based on a tag by Greg Willits local:'alphanumeric' = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; if: !(local_defined:'length'); local:'length' = 20; /if; local:'lp_string_random' = string; loop:(integer:#length); #lp_string_random += #alphanumeric->(get:(integer:(math_random: -lower=1, -upper=62))); /loop; return: #lp_string_random; /define_tag; ]
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Lasso 9 version on GitHub