KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Searches Containing "@" in 4D v6.5
PRODUCT: 4D | VERSION: | PLATFORM:
Published On: June 25, 1999

4D 6.5 can search on strings that contain the @ symbol. For example it is possible to search a field that contains e-mail addresses like you would any other field. For example:

QUERY([Customers];[Customers]Email="john@acme.com")

Implement this by turning on the "Consider @ as a character for Query and Order By" option in the Database properties dialog. When this option has been set, the database will need to be restarted and at that point the indexes will be rebuilt.

This feature affects all searches, sorts and string comparisons for fields and variables. It only affects these operations where the @ character is in the middle of a string. If the @ character is used at the beginning or end of the search criteria in a search, it will be considered a wildcard character.

For example:

ARRAY TEXT($array;3)

$array{1}:="aaa"
$array{2}:="a@a"
$array{3}:="aa@"

$ele:=Find in array($array;"a@")  ` returns 1
$ele:=Find in array($array;"a@a")  ` returns 2