{{fbdoc item="title" value="Operator = (Equal)"}}----
Compares two expressions for equality

{{fbdoc item="syntax"}}##
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgByte|byte]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgByte|byte]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgUbyte|ubyte]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgUbyte|ubyte]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgShort|short]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgShort|short]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgUshort|ushort]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgUshort|ushort]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgInteger|integer]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgInteger|integer]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgUinteger|uinteger]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgUinteger|uinteger]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgLongint|longint]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgLongint|longint]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgUlongint|ulongint]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgUlongint|ulongint]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgSingle|single]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgSingle|single]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgDouble|double]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgDouble|double]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgString|string]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgString|string]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgZstring|zstring]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgZstring|zstring]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgWstring|wstring]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgWstring|wstring]] ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] //T//, [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] //T// ) [[KeyPgAs|as]] [[KeyPgInteger|integer]]
	
	[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **=** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgBoolean|boolean]], [[KeyPgByref|byref]] //rhs// [[KeyPgAs|as]] [[KeyPgBoolean|boolean]] ) [[KeyPgAs|as]] [[KeyPgBoolean|boolean]]
##
{{fbdoc item="usage"}}##
	//result// = //lhs// **=** //rhs//
##
{{fbdoc item="param"}}
	##//lhs//##
		The left-hand side expression to compare to.
	##//rhs//##
		The right-hand side expression to compare to.
	##//T//##
		Any pointer type.

{{fbdoc item="ret"}}
	Returns negative one (-1) if expressions are equal, or zero (0) if unequal.

{{fbdoc item="desc"}}
	**##Operator =## (Equality)** is a binary operator that compares two expressions for equality and returns the result - a boolean value mainly in the form of an ##[[KeyPgInteger|Integer]]##: negative one (-1) for true and zero (0) for false. Only if the left and right-hand side types are both ##[[KeyPgBoolean|Boolean]]##, the return type is also ##[[KeyPgBoolean|Boolean]]##. The arguments are not modified in any way.
	
	This operator can be overloaded to accept user-defined types as well.
	
	**##Operator =## (Equality)** should not be confused with initializations or assignments, both of which also use the "##=##" symbol.

{{fbdoc item="ex"}}

{{fbdoc item="filename" value="examples/manual/operator/equal.bas"}}%%(freebasic)
dim i as integer = 0    '' initialization: initialise i with a value of 0
i = 420                 '' assignment: assign to i the value of 420

if (i = 69) then        '' equation: compare the equality of the value of i and 69
	print "serious error: i should equal 420"
	end -1
end if
%%
	##[[KeyPgOpNotEqual|Operator <>]]## (Inequality) is complement to **##Operator =## (Equality)**, and is functionally identical when combined with ##[[KeyPgOpNot|Operator Not]]## (Bit-wise Complement).

{{fbdoc item="filename" value="examples/manual/operator/equal2.bas"}}%%(freebasic)
   if (420 = 420) then print "(420 = 420) is true."
   if not (69 <> 69) then print "not (69 <> 69) is true."
%%

{{fbdoc item="lang"}}
	- In the //[[CompilerOptlang|-lang qb]]// dialect, this operator cannot be overloaded.

{{fbdoc item="diff"}}
	- none

{{fbdoc item="see"}}
	- ##[[KeyPgOpNotEqual|Operator <>]]## (Inequality)
	- ##{{fbdoc item="keyword" value="KeyPgOpAssignment|Operator =[>]"}}## (Assignment)
 
{{fbdoc item="back" value="CatPgOpConditional|Relational Operators"}}{{fbdoc item="back" value="CatPgOperators|Operators"}}