From Xojo Documentation
|You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!|
The = character is to determine whether one expression is equal to another or to assign a value to a property or variable. String comparisons are case-insensitive.
result = expression1 = expression2
|result||Boolean||Returns True if expression1 is equal to expression2.|
|expression1||String, Number, Boolean, Color, or Object||Any expression.|
|expression2||String, Number, Boolean, Color or Object||Any expression.|
|result||Any||The property, variable, array, or array element that is assigned value.|
|value||Any||The value assigned to result.|
The data types of expression1 and expression2 must match. You can make comparisons between objects of any data type and between objects. If you compare objects, = compares their references, not their contents. For example, when you compare two FolderItems, = determines whether they have the same reference, not whether they point to the same file.
You can use Operator_Compare to define comparisons for classes.
The following example tests whether two strings are equal.
Dim t2 As String = "There"
If t1 = t2 Then
// t1 is equal to t2
// t1 is not equal to t2