Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No Duplicates
Message
 
 
To
05/05/2010 11:36:57
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01462570
Message ID:
01463239
Views:
26
>O_0 but the orginal version didnt exactly work it told me function name missing

Worked fine for me. I posted you the exact script I tested.

Here is the test with the changed code
LOCAL lnI
CREATE CURSOR crsTest (IDFld I, FName c(10))
FOR lnI = 1 TO 10
  INSERT INTO crsTest (FName) VALUES ('Ken')
  INSERT INTO crsTest (FName) VALUES ('David')
  INSERT INTO crsTest (FName) VALUES ('Michael')
  INSERT INTO crsTest (FName) VALUES ('Robert')
NEXT

INDEX on fName TAG fName

PRIVATE pnRec, pcName

pnRec = 0
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 WHILE NOT EOF()

replace IDFld with IIF(pcName = crsTest.fName, nvl(_VFP.SetVar('pnRec',m.pnRec+1), m.pnRec), ;
nvl(_VFP.SetVar('pcName',crsTest.fName),1) * nvl(_VFP.SetVar('pnRec',1), m.pnRec)) WHILE NOT EOF()
browse
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform