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

 dBase  Comments Off on dBASE: When an empty string field does not match “”
Jul 292013

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)

 Posted by on 2013-07-29 at 16:33

tdbf updates – help required

 Delphi  Comments Off on tdbf updates – help required
Jul 272013

I got developer access to the tdbf sourceforge project and made the packages compile with all Delphi versions I have got:

  • Delphi 6
  • Delphi 7
  • Delphi 2005
  • Delphi 2006
  • Delphi 2007
  • Delphi 2009
  • Delphi 2010
  • Delphi XE
  • Delphi XE2 (32 and 64 bits)
  • Delphi XE4 (32 and 64 bits)

I also applied several bugfixes which I already had in my private repository and others I found on the web and in the project’s forums (but not all of them).

Of course compiling does not mean it works. Since I am unlikely to actually use tdbf with anything else but Delphi 2007 and XE2 32 bits in the near future, I need help for all the other versions. So, please, if you use tdbf with any of the other theoretically supported compilers, including the really ancient ones (Anybody still using Delphi 3?) and also C++-Builder and Lazarus/fpc, and are willing to help, test tdbf and send me any patches required to make it compile and work.

Please post to the forums in the tdbf sourceforge project.

I am not the new maintainer of the project, btw., I am only temporarily collecting patches because nobody else does.

 Posted by on 2013-07-27 at 18:49

using and ab-using ifdef

 Delphi  Comments Off on using and ab-using ifdef
Jul 232013

I am currently trying to update an open source project from Delphi 2007 to XE2 and found some code which supposedly already works for XE2. But it is ab-using ifdef in several ways so I thought I’d blog about this to vent some steam and also possibly educate others. Continue reading »

 Posted by on 2013-07-23 at 10:22

GExperts Formatter features you didn’t know about

 Delphi, GExperts  Comments Off on GExperts Formatter features you didn’t know about
Jul 072013

I am sure you did not know about these features (I had forgotten about them myself):

  • You can save your own custom configuration as
    into the GExperts installation directory. After you did that, you can select this configuration in the same way you can the preinstalled configurations.
  • If you want to format a unit differently from your usual
    configuration, put
    at the beginning of it.
    This will make the formatter use the given configuration rather than the currently active one to format that unit
  • If you want to format a whole directory differently from your usual configuration, put a GXFormatter.ini into that directory containing a section [FileSettings] with as many lines as you want of the form
    into it. The formatter will use the <configname> from the first line where <mask> matches the filename of the current file.
 Posted by on 2013-07-07 at 16:43