I think your problem stems from the INDEX ON command. It should be:
INDEX ON &tcField
TAG &lcIndexName
>Gentlemen:
>
>Below is a method of my program that allows changing index order on a grid header click(). This worked fine until today. I am getting calls from all over the country about the "contains unknown command" error.
>
>The error is occuring on the this line:
>
> SET ORDER TO &lcIndexName &lcOrder
>
>IF I change it to
>
> SET ORDER TO (lcIndexName) &lcOrder
>
>it works just fine. Any idea as to what's up?
>
>
>*************************************************************
>
>LOCAL lcOrder, lcIndexName
>
>SELECT cQuoteList
>WITH this
> IF .cColName = ALLTRIM(tcColName)
> .cColOrder = IIF(.cColOrder = 'DESC', 'ASCEND', 'DESC')
> lcIndexName = .cIndexName
> ELSE
> .cColOrder = 'ASCEND'
> .cColName = ALLTRIM(tcColName)
> lcIndexName = SUBSTR(SYS(2015), 3, 10)
> .cIndexName = lcIndexName
>
> INDEX ON &tcField TO &lcIndexName
> ENDIF
>
> lcOrder = .cColOrder
> SET ORDER TO &lcIndexName &lcOrder
> .LockScreen = .T.
> .grdList.refresh()
> LOCATE
> .LockScreen = .F.
>ENDWITH
>
Mark McCasland
Midlothian, TX USA