dBASE: When an empty string field does not match “”

Filtering the current table on a field in dBASE is done like this:

set filter to [condition]

So if you want all records where ANUMBER > 10 you just type this command:

set filter to ANUMBER > 10

It’s as easy as this… unless your field ANAME is a character field and you want all records where it isn’t empty. You are probably tempted to use:

set filter to ANAME <> ""

Oddly enough for my table it did return an empty result, even though I knew there must be records where that field is not empty. After perusing Google (Please stop trying to guess what I am searching for, just search for what I tell you!), giving up and asking a colleague, it turned out the correct filter is this:

set filter to .not. isblank(ANAME)

Or alternatively:

set filter to .not. empty(ANAME)