Test procedure executes multiple times

I have a simple database which records my daily blood pressure and heart rate, sitting and standing. The standing heart rate field has this code attached:

save
call .CheckEntry

The .CheckEntry code is:

let NewDate = mDate + 1
If info("EOF")
    AddRecord
                    message "add record"
Else
    DownRecord
                    message "down record"
EndIf
mDate = NewDate
Field mDate
Field Systolic
save

where the two messages are temporary tests.

Panorama X 10.1 does what you’d expect. v10.2 does this:

What happens if you comment out the Field mDate and Field Systolic statements? My guess is that you only get one added record.

Do fields mDate and Systolic have attached code?

Commenting out makes no difference. No other field has attached code.

Michael, you have 2 save statements: One in the field code, one in the called .CheckEntry procedure. I vaguely remember a thread where it was not recommended to put a save statement into a field code. Maybe my recollection is failing, but if I comment the save statement out of the field code, the procedure works as expected.

P.S.: I forgot to mention a second modification I made: I changed the message statement to a nsnotify statement.

Good call Kurt - removing that save statement solved the problem.

Next logical question - can Jim fix the bug that causes that problem? It’s a totally non-intuitive solution and a mistake that’s easy to make.