ending a math program

  • Thread starter Thread starter andrews
  • Start date Start date
A

andrews

Hi,
When I want to close a program who is always calculating it refuse to
close properly.
I wrote for the code in a button
application.doevents
end

But without result
Must I use threats?
Thanks for any response
 
Hi Andrews.

I suggest that your button.Click method sets a boolean Value to True, and
that in your calculating loop you write:

Application.DoEvents
If MyBooleanValue Then
Me.Close
Else
go on...
End If

or something like that.

Gilbert
 
IMO it would be cleaner. The BackgroundWorker component could help
(basically it calls each of its method on the appropriate thread).
 
andrews said:
Hi,
When I want to close a program who is always calculating it refuse to
close properly.
I wrote for the code in a button
application.doevents
end

But without result
Must I use threats?

Yes. Or better threads. ;-)
 
Must I use threats?

Threatening the code does not help. <g>

You can abort a thread, so that is one option to stopping a program
operation so you can dump a program.

Gilbert also has an interesting idea of adding a Boolean, but it will
add a slight bit of overhead doing it that way. The overhead is small
enough I would not be overly concerned. NOTE, however, that this will
only work if you are in some type of construct that checks for a Boolean
(like a loop).

Peace and Grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Back
Top