Addind indeces on the fly

Hello,
I've been trying (without luck) to add an index to a table on the fly.
According to the docs (I'm using D2 btw), I can use the

TTable.IndexDefs.Add(name, fields, options)

method to do such a thing.  I use it, and it seems to be in IndexDefs
(indexDefs.Count increments, and I can look at it), but when I set
TTable.IndexName to the new index, I get an error saying that the index
does not exist.  Is there anything else that I need to do?

Please respond via email, as well as post replies.

thanks,
Steve Dobbs