Hello every body,
I have a file FACTURES (with a field FAC:Fact_ID and his key FAC:K_FactID) and a second (child) LIGNES (with a field LIG:Fact_ID and his key LIG:K_FactID).
I have a form for create FACTURES records and in this form a browse of LIGNES records (with controls for add/edit/delete records)
If I cancelled FACTURES creating, after adding LIGNES records, I need to delete these records of LIGNES wich have the value of LIG:Fact_ID.
I do this code in close windows embed
This code works well in an old application (my first with clarion, writen there is 15 years ago), but in the new one I have troubles.
for example : if I have 4 records in LIGNES where LIG:Fact_ID = 2, the first time the code is executed (just after created records), only the last record is deleted.
The second time all 3 records are well deleted.
I think, the first time, my code don't read the fisrt record, but the last one. Why? How I could do to be sure I read the first one
Have you some idea?
Many thanks
Have a good day
I have a file FACTURES (with a field FAC:Fact_ID and his key FAC:K_FactID) and a second (child) LIGNES (with a field LIG:Fact_ID and his key LIG:K_FactID).
I have a form for create FACTURES records and in this form a browse of LIGNES records (with controls for add/edit/delete records)
If I cancelled FACTURES creating, after adding LIGNES records, I need to delete these records of LIGNES wich have the value of LIG:Fact_ID.
I do this code in close windows embed
Code:
LIG:Fact_ID = FAC:Fact_ID (for exemple = 2)
set(LIG:K_FactID,LIG:K_FactID)
clear(LIG:Fact_ID)
next(lignes)
loop while LIG:Fact_ID = FAC:Fact_ID
delete(lignes)
clear(lig:record)
next(lignes)
end
This code works well in an old application (my first with clarion, writen there is 15 years ago), but in the new one I have troubles.
for example : if I have 4 records in LIGNES where LIG:Fact_ID = 2, the first time the code is executed (just after created records), only the last record is deleted.
The second time all 3 records are well deleted.
I think, the first time, my code don't read the fisrt record, but the last one. Why? How I could do to be sure I read the first one
Have you some idea?
Many thanks
Have a good day