Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Nivedita Joshi
  Where is Nivedita Joshi?
 pune
 India
 Nivedita Joshi
 Tags
Subject: when & where to use flush command?
Thread ID: 269046 Message ID: 269046 # Views: 40 # Ratings: 0
Version: Visual FoxPro 6 Category: Projects and Design
Date: Friday, July 16, 2010 8:53:00 AM         
   


Hello Experts,

I am having a code where while saving i locks a record with lock()function & after saving unlocks it. I am also having Begin transaction & end transaction command in this code, now i want to use flush command into this so when & where i have to use this command & what's advantages of using flush command? I read foxpro help file but can't understand the description.
i am giving a sample code below :

BEGIN TRANSACTION
Select (Base_fl)
Seek dtos(m.ddoc_date)+m.cdoc_no
If found()
	LOCK()
	If Closeac='Y'
	Replace namount   with m.namount
	Endif
	Unlock
	Select Tran
	Seek dtos(m.ddoc_Date)+m.cdoc_no
	If Found()
		LOCK()
		Replace namount   with m.namount
		Unlock
	Endif
Else
	Rollback
	Select (PassAlias)
	This.Enabled=.t.
	Return
Endif
Select Acctmast
Seek M.cgl_code+M.csl_code
If Found()
	LOCK()
	If Closeac='Y'
		Replace Cac_status With 'C'
	Endif
	If Rptoddate='Y'
	    Replace dtod_due_date with m.ddoc_date
	Endif
	If Rptodamt='Y'
		If Afterbal<0
		Replace ntod_limit with abs(afterpassbal)
		Else
		Replace ntod_limit with abs(afterpassbal)
		Endif
	Endif
	Unlock
Endif
END TRANSACTION	


Please help me.

Regards,
NIVEDITA

ENTIRE THREAD

when & where to use flush command? Posted by Nivedita Joshi @ 7/16/2010 8:53:00 AM
RE: when & where to use flush command? Posted by tushar @ 7/16/2010 9:12:29 AM
RE: when & where to use flush command? Posted by Nivedita Joshi @ 7/16/2010 10:20:45 AM
RE: when & where to use flush command? Posted by tushar @ 7/16/2010 10:37:46 AM
RE: when & where to use flush command? Posted by Anil Sharma @ 7/16/2010 1:35:29 PM