Lasso Soft Inc. > Home

[lp_logical_between]

Linklp_logical_between
AuthorBil Corry
CategoryConditional
Version8.x
LicensePublic Domain
Posted03 Dec 2005
Updated05 Dec 2005
More by this author...

Description

Evaluates if a value is inclusively between a high and low value. Returns true or false.

Sample Usage

lp_logical_between: 5, 2, 6;
'
'; lp_logical_between: 5, 2, 4; '
'; lp_logical_between: 5.2, 5.199999, 5.20001; '
'; lp_logical_between: 'e', 'a', 'f'; '
'; lp_logical_between: 'e', 'a', 'd';

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.

[

define_tag:'lp_logical_between',
	-description='Evaluates if a value is inclusively between a high and low value. Returns true or false.',
	-priority='replace',
	-required='value',
	-required='low',
	-required='high';
	
	select: #value->type;
		case:'integer';
			return: (integer:#value) >= (integer:#low) && (integer:#value) <= (integer:#high);
		case:'decimal';
			return: (decimal:#value) >= (decimal:#low) && (decimal:#value) <= (decimal:#high);
		case:'string';
			return: (string:#value) >= (string:#low) && (string:#value) <= (string:#high);
		case;
			fail: -1, 'Value must be of type integer, decimal, or string.';
	/select;

/define_tag;

]

Comments

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