>ccommand = 'SELECT *,RECNO() AS flagrecno FROM ' + THIS.recordsource + ;
> ' WHERE ' + THIS.cflagfield + ' = .T. INTO CURSOR mycursor'
>&ccommand
>
>SCAN
> i = i+1
> GOTO (mycursor.flagrecno) IN (THIS.recordsource)
> ccommand = 'REPLACE ' + THIS.cseqfield + ' WITH nseq + i IN ' + THIS.recordsource
> &ccommand
>ENDSCAN
>
>Above are two sections of codes I have in my methods. I am wondering if there is a way I can avoid using macro substitution.
>
>Thanks in advance.
>
>
>Tai
First...you should not use RECNO() in an SQL SELECT statement. It is unreliable.
SELECT * FROM (This.RecordSource) WHERE This.cFlagField INTO CURSOR MyCursor
lcField = This.cSeqField
REPLACE &lcField. WITH nSeq + i IN (This.RecordSource)
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer