Lasso Soft Inc. > Home

  • Articles

Great solutions to common problems - Lasso Cook Book

This section houses many solutions to different talks/problems.

Here is a simple example

Why use this code

  if: (field:'cat') == '';

instead of this code

  if: !(field:'cat');

The ! symbol represents a boolean operation and the [Field] tag returns a string. So, when you use (!string) you are relying on the implicit cast of string to boolean and then inverting that. Whereas, when you do (string == '') you are comparing two strings and always know what is going to happen.

For example, (!'false') returns True because the string 'false' is cast to the Boolean value False, but ('false' == '') returns False since it's actually a string comparison.

Author: Fletcher Sandbeck
Created: 25 Feb 2010
Last Modified: 16 Mar 2011

Comments

No comments found
You must be logged in to comment.

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft