Paradox Community

Items in pnews.paradox-programming

Subject:Re: Help with writing tcursor
Date:Fri, 22 May 2020 21:25:00 +0200
From:modridirkac <jure.zorko@gmail.com>
Newsgroups:pnews.paradox-programming
if not tc33.open(...) then errorshiw() return endIF
if not tc33.edit() then errorshow() return endIf
scan tc33:
   if not tc33.lockRecord() then errorshow() return endIf
   tc33."Month" = moy(tc33."Date")
   if not tc33.unlockrecord() the nerrorshow() return endIf
endScan
if not tc33.endEdit() then errorShow() return endif
if not tc33.close() then errorShow() endif

Is field tc33."Month" big enough to fit long months in?
What if "Date" is blank?

I would also change that BIG query to for loop and calculate just one  
month at the time and then add result to your answer.

J.


On Fri, 22 May 2020 21:10:02 +0200, Kevin Baker <shcsbaker@gmail.com>  
wrote:

> Change code to below:
>
> ;Compute Month
> tc33.open(":PRIV:CT3.DB")
> tc33.edit()
> tc33.home()
>
> while not tc33.eot()
>     tc33."Month" = moy(tc33."Date")
>     tc33.nextRecord()
> endWhile
>
> msginfo("","Before tc33 close")
> tc33.endEdit()
> tc33.close()
>
> msginfo("","After tc33 close")
>
>
>
> I get the "Before tc33 close" and then the GPV happens.
>
> I commit out tc33.endEdit() - still get GPV
>
> I add tc33.endEdit() and commit out tc33.close() - still get GPV
>
> I commit out tc33.endEdit() AND tc33.close(), now I don't get the  
> msginfo Before tc33 close and still get GPV
>
>
> I change it to:
> if not tc33.endEdit() then
>     errorShow()
> endif
>
> if not tc33.close() then
>     errorShow()
> endif
>
> now I get the msginfo before, NO GPV and I get the msginfo after.  It  
> works with no errors, but not sure I trust it.


-- 
Using Opera's mail client: http://www.opera.com/mail/


Copyright © 2004 thedbcommunity.com