Subject Re: Delete (all) in a form
From Charlie <tm@tc.com>
Date Mon, 13 Aug 2018 10:51:12 -0400
Newsgroups dbase.getting-started

Hi Akshat... OK that makes sense.  Sorry I'm at work and missed that part.  That absolutely makes sense.  I am so happy!!  I still don't know why the emptytable() didn't work but will fool with that another day if this works.

Thanks very much!!

Akshat Kapoor Wrote:

> On 13/08/2018 19:41, Charlie wrote:
> > I actually tried it with the remaining two and it deleted successfully one row.  I guess the problem is that it is skipping rows.  I'll try more rows later after work... Thanks!!!!
>
> Charlie please go through the entire reply.
> I had posted some corrections to your code also.
>
> Just comment out the p.next() and try again.
> It will work.
> The moment you delete the row the row pointer automatically moves to
> next row so you do not need p.next()
> The moment you delete row 1 rowset pointer moves to row 2 and then you
> issue p.next() which moves the pointer to row 3.
> So effectively you are deleting alternate rows.
>
> Regards
> Akshat
>
> >
> > Akshat Kapoor Wrote:
> >
> >> On 13/08/2018 18:09, Charlie wrote:
> >>> Hi Akshat...
> >>>
> >>> I think either the form or the table are haunted!!!
> >>>
> >>> I changed to a different form of delete in this:
> >>>
> >>> function PUSHBUTTON1_onClick()
> >>>         p=form.pictemp11.rowset
> >>>      //form.train1.emptyTable( "pictemp1" )
> >>>         cnt=p.count()
> >>>         msgbox ( ""+ cnt )
> >>>         p.first()
> >>>         do while cnt > 0
> >>>            p.delete()
> >>>                 cnt = cnt-1
> >>>                 msgbox( ""+CNT )
> >>>                 p.next()
> >> I am not sure and do not have all the files to check but when you issue
> >> p.delete() rowset pointer should automatically move to next row so you
> >> probably won't be needing p.next() comment it out and try once again.
> >>
> >>
> >>>         enddo
> >>>
> >>
> >> You have tried with just 4 rows and hence found 2 left over had you
> >> tried it with more rows there would have been more left.
> >>
> >> Regards
> >> Akshat
> >>
> >
>