473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

sub pause

How to pause in the middle of a sub?

I can not use a timer. The Sub can not be broken in two.

tx,
paul
Nov 20 '05 #1
11 2586
I got it
Threading.Thread.Sleep(2000)

tx

"Paul Mars" <pa************@netzero.com> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl...
How to pause in the middle of a sub?

I can not use a timer. The Sub can not be broken in two.

tx,
paul

Nov 20 '05 #2
Hi Paul,

What do you mean by 'pause'? Will there be a visual button to 'restart', is
the pause for a specified period of time, etc.

Bernie Yaeger

"Paul Mars" <pa************@netzero.com> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl...
How to pause in the middle of a sub?

I can not use a timer. The Sub can not be broken in two.

tx,
paul

Nov 20 '05 #3
I can't figure this:

Original:

picMatch.Image = ImageListTraffic.Images(1)

MessageBox.Show("no match")

s.image = Nothing

picFirstPictureBox.Image = Nothing

The traffic image shows Red for No Match, but I needed a pause before
setting images to nothing. The MessageBox did that, but requires user click,
so:

picMatch.Image = ImageListTraffic.Images(1)

Threading.Thread.Sleep(2000)

s.image = Nothing

picFirstPictureBox.Image = Nothing

but this code does not set the traffic image until after the 2 seconds.
Why?? PS: There is something else that is in a code block above this block
that is also being delayed until after the sleep, so it is not just
everything inside this block. Block may be the wrong term, but hopefully u
understand.

P



"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Paul,

What do you mean by 'pause'? Will there be a visual button to 'restart', is the pause for a specified period of time, etc.

Bernie Yaeger

"Paul Mars" <pa************@netzero.com> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl...
How to pause in the middle of a sub?

I can not use a timer. The Sub can not be broken in two.

tx,
paul


Nov 20 '05 #4
Because in your code below you don't use the currentthread; where your sub
execute itself !

Bismark

"Paul Mars" <pa************@netzero.com> a écrit dans le message de
news:eA****************@TK2MSFTNGP10.phx.gbl...
I can't figure this:

Original:

picMatch.Image = ImageListTraffic.Images(1)

MessageBox.Show("no match")

s.image = Nothing

picFirstPictureBox.Image = Nothing

The traffic image shows Red for No Match, but I needed a pause before
setting images to nothing. The MessageBox did that, but requires user click, so:

picMatch.Image = ImageListTraffic.Images(1)

Threading.Thread.Sleep(2000)

s.image = Nothing

picFirstPictureBox.Image = Nothing

but this code does not set the traffic image until after the 2 seconds.
Why?? PS: There is something else that is in a code block above this block
that is also being delayed until after the sleep, so it is not just
everything inside this block. Block may be the wrong term, but hopefully u
understand.

P



"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Paul,

What do you mean by 'pause'? Will there be a visual button to
'restart', is
the pause for a specified period of time, etc.

Bernie Yaeger

"Paul Mars" <pa************@netzero.com> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl...
How to pause in the middle of a sub?

I can not use a timer. The Sub can not be broken in two.

tx,
paul



Nov 20 '05 #5
* "Paul Mars" <pa************@netzero.com> scripsit:
How to pause in the middle of a sub?

I can not use a timer. The Sub can not be broken in two.


For example, 'System.Threading.Thread.Sleep(1000)'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #6
Hi Herfried,

Did you read that from the answer by Paul which he told he had found it
himself

For example, 'System.Threading.Thread.Sleep(1000)'.

So you can also use this as

For example, 'System.Treading.Thread.Sleep(500)
or
For example, 'System.Treading.Thread.Sleep(4000)

I am glad that you understand this now too, however it is not needed to tell
that to the newsgroup.

:-)))

Cor
Nov 20 '05 #7
* "Cor Ligthert" <no**********@planet.nl> scripsit:
Did you read that from the answer by Paul which he told he had found it
himself


Today in the morning I read it. When posting I was not really sure if
it will help and I didn't see Paul's "self-answer".

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #8
>
Today in the morning I read it. When posting I was not really sure if
it will help and I didn't see Paul's "self-answer".


I did wanted to add to the message from Rado, that a student from Wien deep
in the night had written it, however I stuffed it again.

:-))))

So now I write it.

Cor
Nov 20 '05 #9
I can't figure out from all this how to actually just simply pause any further execution but do all tasks before the pause as the System.Threading.Thread.CurrentThread.Sleep(1000) or System.Threading.Thread.Sleep(1000) halts execeution of some code lines before this statement.
Nov 20 '05 #10
"Barry" <an*******@discussions.microsoft.com> schrieb
I can't figure out from all this how to actually just simply pause
any further execution but do all tasks before the pause as the
System.Threading.Thread.CurrentThread.Sleep(1000) or
System.Threading.Thread.Sleep(1000) halts execeution of some code
lines before this statement.


I'm not sure if I understand. If you want to execute tasks before sleeping,
execute sleep after the tasks - or what do you mean?
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #11
Hi Paul,

The image is not showed for the end of the procedure, so probably never, try
to do a refresh before you let the thread sleep 2 minutes and refresh than
again.

I hope this helps?

Cor
Nov 20 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew | last post by:
When will .NET have a low-pause-time garbage collector A low-pause-time garbage collector would greatly improve .NET's ability to serve as a platform for soft real-time systems. It doesn't have...
5
by: Brian.Steele | last post by:
Greetings everyone. See http://www.spiceisle.com/cgi-bin/slideshow/slideshow.cgi?dir=brian/personal/2005/uk_trip/images&type=jpg The "Pause" button works in IE, but not in Firefox. Any ideas...
11
by: Paminu | last post by:
Is there something like system("PAUSE") for linux?
8
by: Wim | last post by:
My GUI application starts a process (a console program) when the user hits Play. I would like to add an option to pause that process. The code I've added to detect if the user hit pause/unpause...
38
by: Jackie | last post by:
I just want the programme to stop for a while. Thanks.
2
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Is there a way to start, pause and resume a recurrsive search exactly where you left off, say in the registry programmatically? -- Michael Bragg,...
6
by: Peted | last post by:
Hi wondering what is the best way to do this Need a user to click a button, that sends 3 or 4 string based commands via a TCP/ip socket link I can connect to the ip device no problems, am...
8
by: Lloydm | last post by:
I've used the command "pause" in batch files which works ok but I guess it's applied dirrently in c++. Using Dev C++ 4.0 and the following is my code #include<iostream> #include<iomanip>...
3
by: garfunkel214 | last post by:
I have images and text rotating every 7000 ms using a setInterval. i am trying to implement a pause button that will stop the rotation when clicked. When clicked once more, I would like the rotation...
2
by: bmerlover | last post by:
How do I use a PAUSE in .NET Framework using C++ (Visual Studio .NET 2003). I know it's system("pause") in the dos version. But I don't know what it is in the GUI version. I tried...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.