Platforms to show: All Mac Windows Linux Cross-Platform
NSComparisonPredicateMBS class
Super class: NSPredicateMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
class | iCloud | MBS MacCloud Plugin | 11.3 | Yes | No | No | Yes, macOS only | No |
Example:
dim n1 as NSExpressionMBS = NSExpressionMBS.expressionForConstantValue(4)
dim n2 as NSExpressionMBS = NSExpressionMBS.expressionForConstantValue(9)
dim modifier as Integer = NSComparisonPredicateMBS.NSDirectPredicateModifier
dim type as Integer = NSComparisonPredicateMBS.NSGreaterThanPredicateOperatorType
dim options as Integer = 0
dim c as new NSComparisonPredicateMBS(n1, n2, Modifier, type, options)
MsgBox c.predicateFormat
You use comparison predicates to compare the results of two expressions. You create a comparison predicate with an operator, a left expression, and a right expression. You represent the expressions using instances of the NSExpressionMBS class. When you evaluate the predicate, it returns as a BOOL value the result of invoking the operator with the results of evaluating the expressions.
Subclass of the NSPredicateMBS class.
- 6 methods
- method comparisonPredicateModifier as Integer
- method Constructor(LeftExpression as NSExpressionMBS, rightExpression as NSExpressionMBS, modifier as UInt32, type as UInt32, options as UInt32)
- method leftExpression as NSExpressionMBS
- method options as Integer
- method predicateOperatorType as Integer
- method rightExpression as NSExpressionMBS
- shared method predicate(LeftExpression as NSExpressionMBS, rightExpression as NSExpressionMBS, modifier as UInt32, type as UInt32, options as UInt32) as NSPredicateMBS
- 20 constants
Modifier Type Constants
Constant | Value | Description |
---|---|---|
NSAllPredicateModifier | 1 |
A predicate to compare all entries in the destination of a to-many relationship. The left hand side must be a collection. The corresponding predicate compares each value in the left hand side with the right hand side, and returns false when it finds the first mismatch—or true if all match. Available in Mac OS X v10.4 and later. |
NSAnyPredicateModifier | 2 |
A predicate to match with any entry in the destination of a to-many relationship. The left hand side must be a collection. The corresponding predicate compares each value in the left hand side against the right hand side and returns true when it finds the first match—or false if no match is found Available in Mac OS X v10.4 and later. |
NSDirectPredicateModifier | 0 |
A predicate to compare directly the left and right hand sides. Available in Mac OS X v10.4 and later. |
Comparison Type Constants
Constant | Value | Description |
---|---|---|
NSBeginsWithPredicateOperatorType | 8 |
A begins-with predicate. Available in Mac OS X v10.4 and later. |
NSBetweenPredicateOperatorType | 100 |
A predicate to determine if the right hand side lies at or between bounds specified by the left hand side. Returns true if [lhs between rhs]; the right hand side must be an array in which the first element sets the lower bound and the second element the upper, inclusive. Comparison is performed using compare: or the class-appropriate equivalent. Available in Mac OS X v10.5 and later. |
NSContainsPredicateOperatorType | 99 |
A predicate to determine if the left hand side contains the right hand side. Returns true if [lhs contains rhs]; the left hand side must be an NSExpression object that evaluates to a collection Available in Mac OS X v10.5 and later. |
NSCustomSelectorPredicateOperatorType | 11 |
A predicate that uses a custom selector that takes a single argument and returns a BOOL value. The selector is invoked on the left hand side with the right hand side as the argument. Available in Mac OS X v10.4 and later. |
NSEndsWithPredicateOperatorType | 9 |
An ends-with predicate. Available in Mac OS X v10.4 and later. |
NSEqualToPredicateOperatorType | 4 |
An equal-to predicate. Available in Mac OS X v10.4 and later. |
NSGreaterThanOrEqualToPredicateOperatorType | 3 |
A greater-than-or-equal-to predicate. Available in Mac OS X v10.4 and later. |
NSGreaterThanPredicateOperatorType | 2 |
A greater-than predicate. Available in Mac OS X v10.4 and later. |
NSInPredicateOperatorType | 10 |
A predicate to determine if the left hand side is in the right hand side. For strings, returns true if the left hand side is a substring of the right hand side . For collections, returns true if the left hand side is in the right hand side . Available in Mac OS X v10.4 and later. |
NSLessThanOrEqualToPredicateOperatorType | 1 |
A less-than-or-equal-to predicate. Available in Mac OS X v10.4 and later. |
NSLessThanPredicateOperatorType | 0 |
A less-than predicate. Available in Mac OS X v10.4 and later. |
NSLikePredicateOperatorType | 7 |
A simple subset of the MATCHES predicate, similar in behavior to SQL LIKE. Available in Mac OS X v10.4 and later. |
NSMatchesPredicateOperatorType | 6 |
A full regular expression matching predicate. Available in Mac OS X v10.4 and later. |
NSNotEqualToPredicateOperatorType | 5 |
A not-equal-to predicate. Available in Mac OS X v10.4 and later. |
String Comparison Types
Constant | Value | Description |
---|---|---|
NSCaseInsensitivePredicateOption | 1 |
A case-insensitive predicate. You represent this option in a predicate format string using a [c] following a string operation (for example, "NeXT" like[c] "next"). Available in Mac OS X v10.4 and later. These options are supported for LIKE as well as all of the equality/comparison operators. |
NSDiacriticInsensitivePredicateOption | 2 |
A diacritic-insensitive predicate. You represent this option in a predicate format string using a [d] following a string operation (for example, "naïve" like[d] "naive"). Available in Mac OS X v10.4 and later. These options are supported for LIKE as well as all of the equality/comparison operators. |
NSNormalizedPredicateOption | 4 |
Indicates that the strings to be compared have been preprocessed. This option supersedes NSCaseInsensitivePredicateOption and NSDiacriticInsensitivePredicateOption, and is intended as a performance optimization option. You represent this option in a predicate format string using a [n] following a string operation (for example, "WXYZlan" matches[n] ".lan"). Available in Mac OS X v10.7 and later. These options are supported for LIKE as well as all of the equality/comparison operators. |
Super class NSPredicateMBS
- property Handle as Integer
- 6 methods
- method Constructor(predicateFormat as string)
- method Constructor(predicateFormat as string, arguments() as Variant)
- method Constructor(value as boolean)
- method description as string
- method predicateFormat as string
- method Print
- 3 shared methods
- shared method predicateWithFormat(predicateFormat as string) as NSPredicateMBS
- shared method predicateWithFormat(predicateFormat as string, arguments() as Variant) as NSPredicateMBS
- shared method predicateWithValue(value as boolean) as NSPredicateMBS
This class has no sub classes.
Blog Entries
The items on this page are in the following plugins: MBS MacCloud Plugin.
NSComboBoxMBS - NSCompoundPredicateMBS

Links
MBS FileMaker tutorial videos