This surely confuses me....
In PDox 7, I have a form with a button that when clicked, loops through a
database. When certain conditions are met, the 'Tick' field is filled with an
asterisk and a counter 'NrMatches' is updated. At the end, the code reports
'15 records matched'. If I then run a query on the database with field Tick
'not blank' it only retrives 9 records. The database has a unique primary
index.
What could be going on here?
Here's the code:
method pushButton(var eventInfo Event)
var
PupilCur,KlasCur,KlasHistCur,AdvCur TCursor
AdvNam,ClassNam,HigherClassList,LookUpStr String
AdvNum,ClassNum,CurrCITOUpper,NrMatches SmallInt
endvar
IF NOT PupilCur.Open("LLTEMP.DB") THEN
msgStop("Could not open database","LLTEMP.DB")
ENDIF
IF NOT KlasCur.Open("SCHKLAS.DB") THEN
msgStop("Could not open database","SCHKLAS.DB")
ENDIF
IF NOT KlasHistCur.Open("KLASHIST.DB") THEN
msgStop("Could not open database","KLASHIST.DB")
ENDIF
IF NOT AdvCur.Open("SCHADV.DB") THEN
msgStop("Could not open database","SCHADV.DB")
ENDIF
NrMatches = 0
WHILE NOT PupilCur.Eot()
message(PupilCur.RecNo())
ClassNum = PupilCur.TK1KlasType
AdvNum = PupilCur.SchoolAdvies
IF NOT AdvCur.qLocate(AdvNum) THEN
msgStop("Advice not found",string(AdvNum))
ENDIF
AdvNam = AdvCur.Advies;
IF KlasCur.qLocate(ClassNum) THEN
ClassNam = KlasCur.KlasType
IF NOT AdviceOverlapsClass(AdvNam,ClassNam) THEN
HigherClassList = KlasCur.KlasTypesHoger
IF KlasHistCur.Locate("KlasType",ClassNum) THEN
CurrCITOUpper = KlasHistCur.CITOBovenGrens
WHILE HigherClassList <> ""
ClassNum = SmallInt(ParseSt(HigherClassList,","))
LookUpStr = ","+string(ClassNum)+","
IF KlasHistCur.Locate("KlasType",ClassNum) THEN
IF CurrCITOUpper < KlasHistCur.CITOBovenGrens THEN
CITOScore = PupilCur.CITOStandaardScore
IF CITOScore > KlasHistCur.CITOBovenGrens THEN
NrMatches = NrMatches + 1
PupilCur.Edit()
PupilCur.Tick = "*"
message(string(PupilCur.RecNo())+" !!!!!!!!")
ENDIF
ENDIF
ENDIF
ENDWHILE
ENDIF
ENDIF
ENDIF
PupilCur.Skip()
ENDWHILE
message(string(PupilCur.RecNo()) + " records processed; " +
string(NrMatches) + " match")
PupilCur.Close()
AdvCur.Close()
KlasCur.Close()
KlasHistCur.Close()
endmethod
Moving the PupilCur.Edit() to right behind the WHILE NOT eot() does not help,
neither does inserting a PupilCur.PostRecord() behind the PupilCur.Tick
assignment.
Any ideas?
Thanks,
Jan
-----------------------------------------------------------------------
Jan Doggen Masters Software mas...@xs4all.nl
P.O. Box 697 2300 RA Leiden The Netherlands
-----------------------------------------------------------------------
** Specialists in multimedia software for education and presentation **
-----------------------------------------------------------------------
Usage of this email address for commercial purposes costs US$ 50 per
message. By using this email address you agree to this condition.
-----------------------------------------------------------------------
With ordinary checkmarks PDOX will not produce duplicates in the answer
file. If this is your problem then you should either check at least
one field that is unique across the table, or use the checkplus function
in your query.
hth
regards Sven
Jan Doggen wrote:
>
> Hi everyone,
>
> This surely confuses me....
>
> In PDox 7, I have a form with a button that when clicked, loops through a
> database. When certain conditions are met, the 'Tick' field is filled with an
> asterisk and a counter 'NrMatches' is updated. At the end, the code reports
> '15 records matched'. If I then run a query on the database with field Tick
> 'not blank' it only retrives 9 records. The database has a unique primary
> index.
> What could be going on here?
. . . . . (snip)
I should've said that I checked that already ;-)
There *is* a unique key, and I tried both check and checkplus.
Thanks for the try though.
Bye,
Jan
-----------------> PupilCur.endedit() here??????
I dont see an endedit() in your routine... try that... look for the
------------> inserted into your routine above
--
_________________________________
MDEL...@Sierramicro.com
President
Sierra Micro