"=" versus "=="

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I know the difference between "=" and "==" in Java, but is there any difference in B4A? I've been using "=" in place of "==" in my apps and they seem to work okay.
 

joseluis

Active Member
Licensed User
Longtime User
I used always '==' for comparisons, but then I saw other people using '=' so I guess it's indifferent (for comparsions).
 
Upvote 0

Amalkotey

Active Member
Licensed User
Longtime User
@all:

the "=" is an assignment of a1 = 0;
the "==" is a check for "True" and wind used only in the IF statement

B4X:
// Java-Code
if (A1 == 0) then {
  System.out.print("false");
} else {
  System.out.print("true");
}

best regards
Amalkotey
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…