>
>select crsTest
>INDEX on fName TAG fName
>PRIVATE pnRec, pcName
>pnRec = -1
>pcName = crsTest.FName
>
>replace IDFld WITH IIF(crsTest.FName == m.pcName, NVL(_VFP.SetVar('pnRec', m.pnRec+1),1), ;
>NVL(_VFP.SetVar('pcName', crsTest.FName),1) * NVL(_VFP.SetVar('pnRec', 0),1)) * (m.pnRec + 1) IN crsTest NEXT 40
>
>
Ok lets see
select the table, set an index declare variables
Then you Replace the IDfield(the ton of Zeroes granted we didnt do the previous replace) with if and only if the test.fname=m.pcname.
NVL returns statement 2 if statement 1 is null.
so NVL(_VFP.setvar('pnRec',m.pnRec+1),1)= Setvar sets a variable to a value pnrec an pnrec+1 i would believe but if null 1 is returned?
NVL(_VFP.SetVar('pcName', crsTest.FName),1)=same as above mostly but different expressions for 1 and 2
* NVL(_VFP.SetVar('pnRec', 0),1)) * (m.pnRec + 1) IN crsTest NEXT 40= pnrec an 0 is the first expression and if null sis returned 1 is returned?
*(mpnrec+1) not too sure and also not sure about NEXT 40