Subject Re: requery problem (semi reason)
From Mervyn Bick <invalid@invalid.invalid>
Date Thu, 9 Jan 2020 13:36:13 +0200
Newsgroups dbase.getting-started

On 09/01/2020 12:48, Charlie wrote:
> Hi Mervyn... Thanks very much.  I had actually tried something very similar by putting the totals code in it's own funcition.  But that never got off the ground as I was trying to call it by function, not class.
>
> At any rate, unfortunately yours does the exact same thing.
>
> I am testing it an easy way by clicking on the erase all button on the form and cancel.  I did this twice two times in testing this and it failed the second time both times.  Here is my code for the erase button:
>
> function PUSHBUTTON3_onClick()
>            local nanswer
>                 nanswer = msgbox( "Are you sure you want to erase sauc values?","Erase?" , 48+4 )
>        if nAnswer == 6 // Yes
>                    form.master9.rowset.first()
>           do while not form.master8.rowset.endofset

master8 is a typo and it will make dBASE very unhappy. :-)  The
master8.rowset never gets to endofset.  Once your code gets to endofset
in master9.rowset it just keeps on trying until it dies either from
frustration or exhaustion. :-)

What happens if you fix this?

>                       form.master9.rowset.fields["sauc"].value = ""
>                            form.master9.rowset.next()
>                    enddo
>                         //do sauccnt.wfm
>                    //form.close()
>                         msgbox( "All Sauc Erased" )
>                 else
>                    msgbox( "Operation Aborted" )
>                 endif
>        return
>
> This is just the easy way to get it to fail.  It will fail with almost anything you do, although some not in just two tries...
>

Please set your source editor to use spaces not tab characters.  It
won't make any difference to your programs but it will make for much
tidier posts when you copy and paste code.

With anything open in the source editor select Properties->Source Editor
Properties and ensure that the Tab Inserts Spaces option is ticked.

Mervyn.