Do you wish to know how to write it, because all you need to do is also check
to see if the paradox index file is present if not then you would have to
rebuild the index on the table.
use the following code to add a new index
tableName->IndexFiles=Add(nameOfIndex.MDX)
tableName->IndexName=("NAME")
Let me know if this works for you.