Please note that the following code is based on DB3+ functions. I have indicated where the copying should start and finish. I've made some notes after each section PLEASE READ THEM!! I've also left your original lines intact, just look for them and unrem them, if my changes don't work.
IF my modifications DO work, you can delete the debugging section(s) for code compaction.
--Start copying here--
* i don't know if DB4 now stores indices under the MDX extension (as you posted earlier) or if it is a typo. In DB3+ they are stored as Ndx. Not that it matters though.
* i don't know if "dtos()" is similar to "dtoc()".
* i don't know if "TAG" is similar to "TO".
* i don't understand why the middle tag refers to it's self and the other two
* refer to each other -- maybe an infinite loop?
* Anyway, here's what I think may work (again based on DB3+ coding only!)....
* CREATE TAG M_NUMBER
CLOSE ALL
USE Club_mem.dbf
INDEX ON duty_type + weighting + DTOC(next_date) + STR(memno) TO M_Number
* Debugging section
CLEAR
? "This is the current status..."
DISP STAT
* End Debugging section
* This is your original line....
* index on RIGHT(trim(upper(duty_type)),2)+weighting+dtos(next_date)+str(memno) tag typedate
*
*MY NOTES:
* 1) You can ONLY INDEX ON FIELD NAMES!! In other words, you CANNOT index on only a portion of a field's name [ex: INDEX ON [red]RIGHT(trim(upper(duty_type)),2)[/red] ]. Unless this is a special feature of DB4.
*
* 2) Not certain if [red]dtos(next_date)[/red] is valid in DB4, but in DB3+ you need to use the DTOC(next_date) to convert to string format.
*
* 3) Not certain if TAG should point to another TAG that points back to this one. Also, I'm not certain of what a TAG is used for in DB4.
*
* 4) Unknown if the WEIGHTING field is a character or numeric field.
* CREATE TAG TYPENO
CLOSE ALL
USE Club_mem.dbf
INDEX ON DUTY_TYPE + STR(MEMNO) TO TypeEnd
* Debugging section
CLEAR
? "This is the current status..."
DISP STAT
* End Debugging section
* This is your original line....
* INDEX ON LEFT(DUTY_TYPE,2)+STR(MEMNO) TAG TYPENO
*
*MY NOTES:
* 1) You can ONLY INDEX ON FIELD NAMES!! In other words, you CANNOT index on only a portion of a field's name [ex: INDEX ON [red]LEFT(duty_type, 2)[/red] ]. Unless this is a special feature of DB4.
*
* CREATE TAG TYPEDATE
CLOSE ALL
USE Club_mem.dbf
INDEX ON memno TO TypeDate
* Debugging section
CLEAR
? "This is the current status..."
DISP STAT
* End Debugging section
*
* This is your original line....
* INDEX ON memno tag m_number
*
*MY NOTES:
* 1) Not certain if TAG should point to another TAG that points back to this one. Also, I'm not certain of what a TAG is used for in DB4.
* Debugging Section ---- Validate indices
CLOSE ALL
USE Club_Mem.DBF INDEX M_Number, TypeNo, TypeDate
CLEAR
? "This is the current status...It should display DBF name, "
?? "all opened indices, and which one is the MASTER KEY index "
?? "which should be the first one opened: M_Number."
?
?
DISP STATUS
* End Debugging Section
REINDEX
IF .NOT. gl_batch
DO AftAct
ENDIF
--End Copying Here--
Hopefully this will work. Otherwise, I'm going to have to suggest validating the data is in the correct format like making sure that "01/01/1990" doesn't have "01/19/90bo" or that there are no blank fields. Ya, my suggestion will eventually be: "check your data files for corruption" and "run a virus scan too." but only if this doesn't work, due to the fact that I'm using another platform.
Good Luck!
--MiggyD. "The world shrinks more and more with every new user online."