LassoScript Utility
Basics Browse Detail

-OpLogical

Tag Link -OpLogical Category Operator
Type Command Source Available No
Support Abbreviation Version 5.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0
Lasso 3 Equivalent -LogicalOp

Description

-OpLogical sets the logical operator which is used to combine all name/value pairs specified within a search database action. The -OpLogical tag can be set to either AND or OR. The default if no -OpLogical tag is specified is AND.

AND means that each record which is returned matches the criteria of all name/value pairs included in the search action.

OR means that each record which is returned matches the criteria of at least one of the name/value pairs included in the search action.

Syntax

[Inline: -OpLogical=Operator, ...]

<a href="default.lasso?-OpLogical=Operator&...">Link</a>

<form action="default.lasso" method="POST">
  <input type="hidden" name="-OpLogical" value="Operator">
  ...
</form>

Parameters

Required Parameters
Operator The logical operator. One of AND or OR.

Examples

To use an OR logical operator in a database action:

Use the -OpLogical command tag to change the logical operator. The following example specifies a -Search action in [Inline] ... [/Inline] tags. Any records with First_Name of John or Last_Name of Doe are returned.

[Inline: -Search,
    -Database='Contacts',
    -Table='People',
    -OpLogical='OR',
    'First_Name'='John',
    'Last_Name'='Doe']
  [Records]
    <br>[Field: 'First_Name'] [Field: 'Last_Name']
  [/Records]
[/Inline]

<br>John Doe
<br>Jane Doe
<br>John Surname