KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Different behaviors of "@" character depending on the side of a comparison
PRODUCT: 4D | VERSION: 17 | PLATFORM: Mac & Win
Published On: January 3, 2019
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

When making a string comparison with the @ wildcard, the common convention is to use the wildcard string on the right side of the comparison. The reason for this convention is that the "@" character is only treated as a wildcard on the right side and a literal character on the left side. Take for example a string comparison between "abc" and "a@c" used in alternating sides.

C_BOOLEAN($yResult1;$yResult2)
$yResult1:=("abc"="a@c")
$yResult2:=("a@c"="abc")


For the first result,"a@c" is treated as the wildcard string where the wildcard will take effect and the boolean evaluates to True. For the second result, "a@c" is treated as a literal string where the wildcard is completely ignored and the boolean evaluates to False.



In short, always be sure to use any strings with wildcards on the right side of the comparison in order for the "@" character to take effect.