Link | C_Compare |
Author | Göran Törnquist |
Category | Comparator |
Version | 8.x |
License | Public Domain |
Posted | 22 Oct 2007 |
Updated | 22 Oct 2007 |
More by this author... |
Replacement of the built-in comparators that works with all types of arrays. These avoids a runtime exception when keywords are used in the arrays.
local('array1'=array(-database='work', -op='gt', 'few', 'blue'='purple')); #array1->find(match_comparator(\c_compare_contains, -rhs='blue'));
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.
beginswith(#right) ? 0 | -1); /define_tag; define_tag('c_comparator_endswith', -optional='left', -optional='right'); return(local_defined('left') && local_defined('right') && #left->endswith(#right) ? 0 | -1); /define_tag; define_tag('c_comparator_contains', -optional='left', -optional='right'); return(local_defined('left') && local_defined('right') && #left->contains(#right) ? 0 | -1); /define_tag; define_tag('c_comparator_equalto', -optional='left', -optional='right'); return(local_defined('left') && local_defined('right') && #left == #right ? 0 | -1); /define_tag; define_tag('c_comparator_greaterthan', -optional='left', -optional='right'); return(local_defined('left') && local_defined('right') && #left > #right ? 0 | -1); /define_tag; define_tag('c_comparator_lessthan', -optional='left', -optional='right'); return(local_defined('left') && local_defined('right') && #left < #right ? 0 | -1); /define_tag; define_tag('c_comparator_notcontains', -optional='left', -optional='right'); return(local_defined('left') && local_defined('right') && #left !>> #right ? 0 | -1); /define_tag; define_tag('c_comparator_strictequalto', -optional='left', -optional='right'); return(local_defined('left') && local_defined('right') && #left === #right ? 0 | -1); /define_tag; define_tag('c_comparator_strictnotequalto', -optional='left', -optional='right'); return(local_defined('left') && local_defined('right') && #left !== #right ? 0 | -1); /define_tag; ?>
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft