Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Altering the behaviour of the coalesce function
Wed, Apr 30 2008 10:45 AMPermanent Link

Uli Becker
I really like the coalesce function. But in many cases it doesn't help
me because it only works with null-values, not empty strings.

Therefore I changed the code like this:

procedure TEDBExprEvaluator.EvaluateCOALESCE(Token: TEDBExprToken);
var
  I: Integer;
begin
  with Token do
  begin
    Value.Null := True;
    for I := 0 to NumArguments - 1 do
    begin
      EvaluateNextToken(ArgumentTokens[I]);
      // if (not ArgumentTokens[I].Value.Null) then  <------------OLD
      if  ArgumentTokens[I].Value.AsString <> '' then  <---------NEW
      begin
        Value.Assign(ArgumentTokens[I].Value, False);
        Break;
      end;
    end;
  end;
end;

Is that ok or have I to be scared of any problems in the future?

Thanks Uli.
Wed, Apr 30 2008 10:51 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Is that ok or have I to be scared of any problems in the future? >>

Well, apart from every new release putting it back the way it was, no. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Apr 30 2008 11:54 AMPermanent Link

Uli Becker
Tim

> Well, apart from every new release putting it back the way it was, no. Smiley

That's exactly what I thought. If I forget the change it can turn out to
backfire Smiley

Regards Uli
Thu, May 1 2008 3:09 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


And what about when emptystring = null again?

Roy Lambert
Thu, May 1 2008 6:27 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< And what about when emptystring = null again? >>

It's on the list.  As I said, I'm a little under the weather this week, so
things are progressing slowly this week.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, May 1 2008 7:26 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


Ah yes, I know the cold problem well. Mind feels like its wrapped in cotton wool, things don't make sense, its difficult to remember and often everything feels such an effort.

I'm glad you're enjoying yourself Smiley

However, the post wasn't a reminder, more a "is this mod going to be needed when" question.

Roy Lambert
Thu, May 1 2008 8:21 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< However, the post wasn't a reminder, more a "is this mod going to be
needed when" question. >>

Ahh, sorry.  No, this mod wouldn't be needed in such a case.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image