>>The function returns a string, not an explicit memo, so it's indexable. Look at the difference between TYPE('mMemoField') and TYPE('UPPER(mMemoField)'). BTW, this is one of those cases where VARTYPE() and TYPE() are not interchangable, because a field is involved.
>>
>>Other problems related to maximum key length may arise from using a memo field as an index source; if the longest memo field content is over 240 chars, the index operation will fail during index creation...and there are all sorts of consequences - the length of the key is established at the time of tag creation, which can cause mis-sortation for memo fields whose data content length exceeds the initial longest memo field's length and creation will fail if all the memo fields are empty.
>
>Actually the index key is created using the first record in the table at the time of index creation. So if your first record falls within the 240 character limit, the error isn't generated.
I'm not sure if it's the first record or the current record; try the following to watch it fail and work based on the current record content:
CREATE TABLE temp01 (Fld1 m)
INSERT INTO temp01 VALUES (space(10))
INSERT INTO temp01 VALUES (space(1000))
index on upper(Fld1) TAG ItFails && blows up
go top
index on upper(Fld1) TAG ItWorks && creates
delete tag all
insert into temp01 VALUES (space(0))
index on upper(Fld1) TAG ItFailsAgain && blows up
So it looks to be an issue of the length of the memo in the current record at the time of index creation. This makes it effectively impossible to pre-create an index on a memo without something like a PAD-type operation for an empty table.