Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No Duplicates
Message
From
05/05/2010 10:38:15
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01462570
Message ID:
01463216
Views:
25
>
>select crsTest && use the name of the cursor you created
>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
>
>&&browse
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform