Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace code in Form with Biz Method
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Replace code in Form with Biz Method
Miscellaneous
Thread ID:
01671085
Message ID:
01671085
Views:
69
Hi,

I am working on refactoring the following code. Currently the code (pretty long, about 2000 lines) is executed in a method of a button click. And I am "moving" this code to a method of a Biz class.
The form, on which the button reside, has text box controls that shows the progress. E.g. "Processing records number # ...", "Order Number: " + OrderNo. So, that the user knows that something is going one.
The BIZ method code has to update the form controls (the progress above). Here is the segment of the current code that shows the progress:
	thisform.wo_count.value = alltrim(str(nCountOrders))
	thisform.wo_number.value = alltrim(str( CUR_PM_WOS.WO_NUMBER )	)		
	thisform.equipment_id.Value = CUR_PM_WOS.EQUIP_ID
	Thisform.Draw

	DOEVENTS 
How would you suggest to update the Form controls from the BIZ object code?

TIA

UPDATE. One idea I have is to pass the form reference to the BIZ method. But it seems to be a kludge.

UPDATE 2. Another question is how to deal with a user interrupting the process. The form has Cancel button which set the form property lExit to .T. And the Process code checks for this value. Of course, when the Process code runs in a Biz method, the form property is out of scope. Unless, again, I pass the form reference to the BIZ method. But I am thinking/looking for a better solution/approach
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform