Link | lp_string_asc |
Author | Bil Corry |
Category | String |
Version | 8.x |
License | Public Domain |
Posted | 17 Jan 2006 |
Updated | 17 Jan 2006 |
More by this author... |
Returns the base10 integer value given a text character.
Requires [lp_math_dectobin] [lp_math_bintodec] [lp_integer_toUnsigned]
[ var:'a' = (lp_string_chr: (array: 195, 164)); $a ' = '; (lp_string_asc: $a); ' or '; (lp_math_dectooctet:(lp_string_asc: $a)); '
'; (lp_string_chr: 50084); ]
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_asc', -description='Returns the base10 integer value given a text character.', -priority='replace', -required='chr', -optional='text_encoding'; // usage: [asc: 'T'] returns 84 if: !(local_defined:'text_encoding'); local:'text_encoding' = $__encoding__; /if; local:'bytes' = bytes; #bytes->(importstring: #chr, #text_encoding); local:'return' = string; local:'loop' = #bytes->size; loop: #loop; #return += (lp_math_dectobin: (lp_integer_toUnsigned:(#bytes->export8bits))); /loop; return: (lp_math_bintodec: #return); /define_tag; ]
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft