What's wrong with this formula?

The output from the following code, in a ComputedText element, is confusing me:

@Text(@Elements(editDate)) + ": " + editDate[1] + @NewLine +

@Text(@If(@Elements(editDate) <= 0)) + @NewLine +

@Text(@If(@Trim(editDate[1]) = “”))

The output is as follows:

13: 11/6/2007 11:43:09 AM

0

0

In other words, there are thirteen elements, the first one has a value of 11/6/7.

But when I test the count of values for less than 1, it returns false; and if I test the first value for existence, the test returns false. These tests should return TRUE!

This shouldn’t be happening. What’s going wrong?

Thanks,

-Jeff

PS Here’s what I’m really trying to do:

count := @Elements(editDate);

@If(count <= 0 | @Trim(editDate[1]) = “”; @Return(“”); “”);

@For(i := 1; i <= count; i := i + 1;

HTML := HTML + "<TR ><TD VALIGN=TOP >" + editDate[i] + "</TD>";

HTML := HTML + "<TD VALIGN=TOP >" + editName[i] + "</TD>";

HTML := HTML + "<TD VALIGN=TOP>" + action[i] + "</TD>";

HTML := HTML + "<TD VALIGN=TOP>" + oldVal[i] + "</TD>";

HTML := HTML + "<TD VALIGN=TOP>" + newVal[i] + "</TD>";

HTML := HTML +  "</TR>" + @NewLine);

Subject: What’s wrong with this formula?

You mention that you are testing for existance, but the code says: (@If(@Trim(editDate[1]) = “”))

which results is FALSE.

That is correct. There is a value. It is not blank.

Subject: What’s wrong with this formula?

Nothing’s wrong - both of your tests are returning false as they should.

@Elements(editDate) <= 0 13 is not less-then, or equal to zero

@Trim(editDate[1]) = “” Trimming a date/time does not return an empty string.

Subject: RE: What’s wrong with this formula?

Doh! Of course.

I’m sleepworking today (obviously).

Thanks.

-Jeff