KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Comparisons using the "=" symbol
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: May 22, 2002

Platform: Plug-in API

This is just a reminder that when writing code that does a comparison, as you might inside an If statement, you need to be careful when using the "=" operator. The "=" works slightly differently than it does in 4D.

The following 4D code

If (vSalary = 50000)

Is equivalent to the following C code

If (vSalary == 50000)

Notice that when using C the operator is two "=", like so "==". Try to keep this in mind because if you use a single "=" it is telling C to assign the value and not compare the two values. So remember that when doing comparisons in C you need to use "==" instead of "=".