Tag Archives: FINDFIRST

More about ISEMPTY

I had much second thought about whether I should even blog this one. You know, it so profoundly belongs in the Duh! category that I have actually created the Duh! category specifically for this post.

Now, fasten your seatbelt. I apologize for what you are about to see,  but apparently people do write code as the example below. And I sh*t you not, you can’t really make this crap up, but this is what people do:

IF NOT Cust.ISEMPTY THEN
  REPEAT
    DoSomethingStupid(Cust);
  UNTIL Cust.NEXT = 0;

Wat?

Continue reading More about ISEMPTY

The “IF COUNT = 1” Conundrum

If you haven’t read my yesterday’s post, then do that first.

Good. At this point you are extremely smart because you know that you should never use COUNT = 0 but should use ISEMPTY instead.

However, what if:

IF SomeTable.COUNT = 1 THEN
  DoSomething();

Well, if this is what you need, then that’s what you need. And that’s exactly what we needed in the team a few days ago.

Continue reading The “IF COUNT = 1” Conundrum