473,320 Members | 1,914 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,320 software developers and data experts.

Stopping a while loop with user input ?

ern
I have a program that runs scripts. If the user types "script
myScript.dat" the program will grab commands from the text file, verify
correctness, and begin executing the script UNTIL...

I need a way to stop the execution with user input. I was thinking
something like this:

while(user hasn't pressed 'any key'){
keepExecutingScript();
}

How can I do the "user hasn't pressed 'any key' " of this logic?
Running Linux Red Hat V3.

Thanks,

Nov 15 '05 #1
23 3878
ern wrote:
I have a program that runs scripts. If the user types "script
myScript.dat" the program will grab commands from the text file, verify
correctness, and begin executing the script UNTIL...

I need a way to stop the execution with user input. I was thinking
something like this:

while(user hasn't pressed 'any key'){
keepExecutingScript();
}

How can I do the "user hasn't pressed 'any key' " of this logic?
Running Linux Red Hat V3.


This cannot done in standard C; try comp.unix.programmer

Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 15 '05 #2
ern wrote:
I need a way to stop the execution with user input. I was thinking
something like this:

while(user hasn't pressed 'any key'){
keepExecutingScript();
}

http://www.eskimo.com/~scs/C-faq/q19.1.html

Brian

--
Please quote enough of the previous message for context. To do so from
Google, click "show options" and use the Reply shown in the expanded
header.
Nov 15 '05 #3
In article <11**********************@g44g2000cwa.googlegroups .com>,
ern <er*******@gmail.com> wrote:
I have a program that runs scripts. If the user types "script
myScript.dat" the program will grab commands from the text file, verify
correctness, and begin executing the script UNTIL...

I need a way to stop the execution with user input. I was thinking
something like this:

while(user hasn't pressed 'any key'){
keepExecutingScript();
}


If you're allowed to choose which key the user uses to interrupt the
program, there's a good chance you can do this without going beyond what
the standard defines.
(This may or may not be something you'd want to do instead of using
something system-specific instead.)

Most implementations have a way to cause SIGINT to be raised in a running
program, so you can just install a handler that sets a flag indicating
it's time to stop, and check that in your main loop.
(Note that the way you arrange for SIGINT to be raised asynchronously
is entirely dependent on your system and there may not be a way at all.
(All of the systems that used nontrivially use ctrl-C by default, but
check your documentation.) So you're not actually gaining portability
to systems that don't support user-caused SIGINT, you're just gaining
not having to change the code to move between systems that do.)

--------
#include <signal.h>

volatile sig_atomic_t time_to_stop=0;

void sigint_handler(int ignored)
{
time_to_stop=1;
/*Revert to the default signal handler (usually immediate
termination) for if the user gets impatient and interrupts
again
*/
signal(SIGINT,SIG_DFL);
}

void do_main_loop(some_args args)
{
void (*old_sighandler)(int);

old_sighandler=signal(SIGINT,sigint_handler);
if(old_sighandler==SIG_IGN)
{
/*Assume it was ignored for a good reason, re-ignore*/
signal(SIGINT,SIG_IGN);
}
if(old_sighandler==SIG_ERR)
{
report_signal_installation_error();
abort_if_we_dont_want_to_continue_uninterruptible( );
}

while(time_to_stop==0)
{
keep_executing_script(args);
}
do_any_cleanup_required();

/*Depending on what comes next, we may want to restore the original
handler:
*/
if(old_sighandler!=SIG_ERR)
signal(SIGINT,old_sighandler);
}
--------

Note that the things you can do in a handler for an asynchronous signal
are seriously limited. Storing a value in an object of type volatile
sig_atomic_t is guaranteed to do what you'd expect (store the value
completely and correctly and become available the next time it's checked
outside the signal handler), and using signal() to install a new handler
for the signal you're handling is also well-defined. Calling most library
functions isn't safe, examining and/or modifying most objects isn't safe,
and there's really not a whole lot that you can do without trying to do
one or the other of those.
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca

Don't write in troglodyte here, it annoys the natives.
--Lawrence Kirby in comp.lang.c
Nov 15 '05 #4
"ern" <er*******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I have a program that runs scripts. If the user types "script
myScript.dat" the program will grab commands from the text file, verify correctness, and begin executing the script UNTIL...

I need a way to stop the execution with user input. I was thinking
something like this:

while(user hasn't pressed 'any key'){
keepExecutingScript();
}

How can I do the "user hasn't pressed 'any key' " of this logic?
Running Linux Red Hat V3.


getch() might work.

--
Mabden
Nov 15 '05 #5
On 2005-10-26, Mabden <mabden@sbc_global.net> wrote:
"ern" <er*******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I have a program that runs scripts. If the user types "script
myScript.dat" the program will grab commands from the text file,

verify
correctness, and begin executing the script UNTIL...

I need a way to stop the execution with user input. I was thinking
something like this:

while(user hasn't pressed 'any key'){
keepExecutingScript();
}

How can I do the "user hasn't pressed 'any key' " of this logic?
Running Linux Red Hat V3.


getch() might work.


however, you need curses for that. The only "portable" way to do
this would be to use SIGINT and limit the user's ability to stop
the "script" to causing SIGINT (in an implementation-defined way:
on any unix system this is controlled by the tty driver and is
caused by default by hitting ctrl-c - it's not unreasonable to
use ctrl-c and/or ctrl-break on windows/dos, etc.)

your signal handler could set a global variable that is then
checked in the while loop.

it's also a lot easier than using curses, and a lot more in
keeping with how other unix-ish applications do things.
Nov 15 '05 #6
"Jordan Abel" <jm****@purdue.edu> wrote in message
news:sl********************@random.yi.org...
On 2005-10-26, Mabden <mabden@sbc_global.net> wrote:
"ern" <er*******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I have a program that runs scripts. If the user types "script
myScript.dat" the program will grab commands from the text file,

verify
correctness, and begin executing the script UNTIL...

I need a way to stop the execution with user input. I was thinking
something like this:

while(user hasn't pressed 'any key'){
keepExecutingScript();
}

How can I do the "user hasn't pressed 'any key' " of this logic?
Running Linux Red Hat V3.


getch() might work.


however, you need curses for that. The only "portable" way to do
this would be to use SIGINT and limit the user's ability to stop
the "script" to causing SIGINT (in an implementation-defined way:
on any unix system this is controlled by the tty driver and is
caused by default by hitting ctrl-c - it's not unreasonable to
use ctrl-c and/or ctrl-break on windows/dos, etc.)

your signal handler could set a global variable that is then
checked in the while loop.

it's also a lot easier than using curses, and a lot more in
keeping with how other unix-ish applications do things.


Curses? Unixish? what's that? My 'puter speaks DOS. My compiler knows
getch() and so does my bible, the K&R.

Can't he read a line of script and then check if a key was hit? I mean,
the one line of the script may take a little while to finish, but at
least the whole script doesn't have to finish before the user gets
control.

SIGINT is fine, but seems overkill for processing a script, since you
can just poll after every line. I use SIGINT for trapping Ctrl-C to stop
something lengthy like parsing a directory tree, but a script file of
presumably short-lived commands could be halted by just polling the
keyboard buffer with getch(). Unless the script was something like:

1 cure cancer
2 cure Michael Jackson
3 fix Madben

--
Mabden

--
Mabden
Nov 15 '05 #7
On 2005-10-26, Mabden <mabden@sbc_global.net> wrote:
"Jordan Abel" <jm****@purdue.edu> wrote in message
news:sl********************@random.yi.org...
On 2005-10-26, Mabden <mabden@sbc_global.net> wrote:
> "ern" <er*******@gmail.com> wrote in message
> news:11**********************@g44g2000cwa.googlegr oups.com...
>> I have a program that runs scripts. If the user types "script
>> myScript.dat" the program will grab commands from the text file,
> verify
>> correctness, and begin executing the script UNTIL...
>>
>> I need a way to stop the execution with user input. I was thinking
>> something like this:
>>
>> while(user hasn't pressed 'any key'){
>> keepExecutingScript();
>> }
>>
>> How can I do the "user hasn't pressed 'any key' " of this logic?
>> Running Linux Red Hat V3.
>
> getch() might work.
however, you need curses for that. The only "portable" way to do
this would be to use SIGINT and limit the user's ability to stop
the "script" to causing SIGINT (in an implementation-defined way:
on any unix system this is controlled by the tty driver and is
caused by default by hitting ctrl-c - it's not unreasonable to
use ctrl-c and/or ctrl-break on windows/dos, etc.)

your signal handler could set a global variable that is then
checked in the while loop.

it's also a lot easier than using curses, and a lot more in
keeping with how other unix-ish applications do things.


Curses? Unixish? what's that? My 'puter speaks DOS. My compiler knows
getch() and so does my bible, the K&R.


there is a getch() that exists on DOS and one that exists on unix.
they do not have the same semantics. K&R uses the name, but it is
for neither of the two commonly-existing functions of that name, but
rather of its own example of how one might write a getc-ish function
that could play nice with an ungetc-ish one. Moreover, the getch in
K&R, the one in unix/curses under some circumstances, and the dos
one, will ALL block until the user actually presses a key - none of
them [except the curses one under SOME sets of options] will return
immediately if there is no key pressed by the user.
Can't he read a line of script and then check if a key was hit? I mean,
the one line of the script may take a little while to finish, but at
least the whole script doesn't have to finish before the user gets
control.
he _can_ do it, using the curses getch()
SIGINT is fine, but seems overkill for processing a script, since you
can just poll after every line. I use SIGINT for trapping Ctrl-C to stop
something lengthy like parsing a directory tree, but a script file of
presumably short-lived commands could be halted by just polling the
keyboard buffer with getch(). Unless the script was something like:


the problem is that getch() will not return if there is _not_ a
character. [well, you can do it with curses, but it's tricky]
Nov 15 '05 #8
"Jordan Abel" <jm****@purdue.edu> wrote in message
news:sl********************@random.yi.org...
On 2005-10-26, Mabden <mabden@sbc_global.net> wrote:
the problem is that getch() will not return if there is _not_ a
character. [well, you can do it with curses, but it's tricky]


Oops.. so That's why I use SIGINT... I looked back at some DOS programs
and there were more of them than I remembered. But they all seemed to be
for Ctrl-C handling.

Did the OP say they wanted to trap "The Any Key" or a specific key? Does
SIGINT flag, say a space bar? I forget, since I used it to exit
gracefully from a program when ctrl-c or ctrl-break was hit. What about
the old ctrl-d ctrl-s combo for pausing and restarting a program, maybe
that might work for the OP.

I guess I need to read the first post. ;-)

--
Mabden
Nov 15 '05 #9
Mabden wrote:
"ern" <er*******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I have a program that runs scripts. If the user types "script
myScript.dat" the program will grab commands from the text file,


verify
correctness, and begin executing the script UNTIL...

I need a way to stop the execution with user input. I was thinking
something like this:

while(user hasn't pressed 'any key'){
keepExecutingScript();
}

How can I do the "user hasn't pressed 'any key' " of this logic?
Running Linux Red Hat V3.

getch() might work.

Just when I thought you were learning.. getch() simply does not exist in
Standard C, the topic of this newsgroup. Various implementations may
provide it (an others) as extensions but it isn't C.

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Nov 15 '05 #10
"Joe Wright" <jw*****@comcast.net> wrote in message
news:Kd********************@comcast.com...
Mabden wrote:
getch() might work.
Just when I thought you were learning.. getch() simply does not exist

in Standard C, the topic of this newsgroup. Various implementations may
provide it (an others) as extensions but it isn't C.


Awww.. how sweet, you thought...

getch() is on page 78-79 of the only C standard that matters, K&R2.

I've never compiled a program using getch() and had it fail. But as I
said, I was surprized to find that I actually used SIGINT more than I
thought, and getch() less than you think.

So, while you are not wrong - you're wrong! ;-)

--
Mabden
Nov 15 '05 #11
On 2005-10-27, Mabden <mabden@sbc_global.net> wrote:
"Joe Wright" <jw*****@comcast.net> wrote in message
news:Kd********************@comcast.com...
Mabden wrote:
> getch() might work.
>

Just when I thought you were learning.. getch() simply does not
exist in Standard C, the topic of this newsgroup. Various
implementations may provide it (an others) as extensions but it
isn't C.


Awww.. how sweet, you thought...

getch() is on page 78-79 of the only C standard that matters,
K&R2.

I've never compiled a program using getch() and had it fail. But
as I said, I was surprized to find that I actually used SIGINT
more than I thought, and getch() less than you think.

So, while you are not wrong - you're wrong! ;-)


You are incorrect. K&R2 does NOT claim getch() exists or a standard
function. It uses the name in an example, which is in fact an
implicit claim that it is NOT a standard function
Nov 15 '05 #12
Mabden wrote:
"Joe Wright" <jw*****@comcast.net> wrote in message
news:Kd********************@comcast.com...
Mabden wrote:
getch() might work.
Just when I thought you were learning.. getch() simply does not exist
in
Standard C, the topic of this newsgroup. Various implementations may
provide it (an others) as extensions but it isn't C.


Awww.. how sweet, you thought...

getch() is on page 78-79 of the only C standard that matters, K&R2.


Where it provides an implementation of getch which has different
semantics to the implementation I have on my Linux box and different
semantics to the implementation provided my MS in their C library. If
you look at Appendix B which describes the standard library you will
find absolutely NO reference to getch.

Also, it is the ISO standard that defines C and therefore what is
topical here, K&R2 is merely a very good, but not perfect, book about
the language.
I've never compiled a program using getch() and had it fail.
Which proves nothing apart from your experience being limited.
But as I
said, I was surprized to find that I actually used SIGINT more than I
thought, and getch() less than you think.

So, while you are not wrong - you're wrong! ;-)


No, Joe is COMPLETELY correct and you are COMPLETELY wrong.

Since you are obviously not improving I'll put you back in the kill file.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Nov 15 '05 #13
"Flash Gordon" <sp**@flash-gordon.me.uk> wrote in message
news:mc************@news.flash-gordon.me.uk...
Since you are obviously not improving I'll put you back in the kill

file.
Hey! I just got to stretch my legs! Haven't you ever been wrong!!

--
Mabden

Nov 15 '05 #14
Jordan Abel wrote:
K&R2 does NOT claim getch() exists or a standard function.
You are correct.
It uses the name in an example, which is in fact an
implicit claim that it is NOT a standard function


You would think so, but there is a counterexample in K&R.

http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html

119-121(§5.11): The qsort discussion needs recasting in several ways.
First, qsort is a standard routine in ANSI/ISO C, so
the rendition here should be given a different name, especially because
the arguments to standard qsort are a bit different: the
standard accepts a base pointer and a count, while this example uses a
base pointer and two offsets.

--
pete
Nov 15 '05 #15
pete <pf*****@mindspring.com> writes:
Jordan Abel wrote:
K&R2 does NOT claim getch() exists or a standard function.


You are correct.
It uses the name in an example, which is in fact an
implicit claim that it is NOT a standard function


You would think so, but there is a counterexample in K&R.

http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html

119-121(§5.11): The qsort discussion needs recasting in several ways.
First, qsort is a standard routine in ANSI/ISO C, so
the rendition here should be given a different name, especially because
the arguments to standard qsort are a bit different: the
standard accepts a base pointer and a count, while this example uses a
base pointer and two offsets.


But using the name "qsort" in an example *is* an implicit claim that
it's not a standard function. It happens to be an incorrect claim,
which is why it's mentioned in the errata.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #16
"Keith Thompson" <ks***@mib.org> wrote in message
news:ln************@nuthaus.mib.org...
pete <pf*****@mindspring.com> writes:
Jordan Abel wrote:
K&R2 does NOT claim getch() exists or a standard function.


You are correct.
It uses the name in an example, which is in fact an
implicit claim that it is NOT a standard function


You would think so, but there is a counterexample in K&R.

http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html

119-121(§5.11): The qsort discussion needs recasting in several ways. First, qsort is a standard routine in ANSI/ISO C, so
the rendition here should be given a different name, especially because the arguments to standard qsort are a bit different: the
standard accepts a base pointer and a count, while this example uses a base pointer and two offsets.


But using the name "qsort" in an example *is* an implicit claim that
it's not a standard function. It happens to be an incorrect claim,
which is why it's mentioned in the errata.


So none of the programs named in K&R (2 in my version) are actually in
The Standard? Is that canonical? Have you checked this yourself, or is
it hearsay?

--
Mabden
Nov 15 '05 #17
On 2005-10-28, Mabden <mabden@sbc_global.net> wrote:
"Keith Thompson" <ks***@mib.org> wrote in message
news:ln************@nuthaus.mib.org...
pete <pf*****@mindspring.com> writes:
> Jordan Abel wrote:
>
>> K&R2 does NOT claim getch() exists or a standard function.
>
> You are correct.
>
>> It uses the name in an example, which is in fact an
>> implicit claim that it is NOT a standard function
>
> You would think so, but there is a counterexample in K&R.
>
> http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html
>
> 119-121(§5.11): The qsort discussion needs recasting in several ways. > First, qsort is a standard routine in ANSI/ISO C, so
> the rendition here should be given a different name, especially because > the arguments to standard qsort are a bit different: the
> standard accepts a base pointer and a count, while this example uses a > base pointer and two offsets.


But using the name "qsort" in an example *is* an implicit claim that
it's not a standard function. It happens to be an incorrect claim,
which is why it's mentioned in the errata.


So none of the programs named in K&R (2 in my version) are actually in
The Standard? Is that canonical? Have you checked this yourself, or is
it hearsay?


No program which contains a definition of a standard function is
permitted on a conforming hosted implementation. With the sole (i
believe) exceptions of the qsort function and the unix-specific
examples in chapter 8, all the examples in K&R conform to the
standard.
Nov 15 '05 #18
On Fri, 28 Oct 2005 10:43:44 +0000 (UTC), in comp.lang.c , Jordan Abel
<jm****@purdue.edu> wrote:
No program which contains a definition of a standard function is
permitted on a conforming hosted implementation.


I believe thats incorrect. My understanding is that the names are only
reserved if you include the header.

7.1.3 Reserved Identifiers
- Each identifier with file scope listed in any of the following
subclauses (including the future library directions) is reserved for
use as a macro name and as an identifier with file scope in the same
name space if any of its associated headers is included.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 15 '05 #19
Mark McIntyre wrote:
On Fri, 28 Oct 2005 10:43:44 +0000 (UTC), in comp.lang.c , Jordan Abel
<jm****@purdue.edu> wrote:
No program which contains a definition of a standard function is
permitted on a conforming hosted implementation.


I believe thats incorrect. My understanding is that the names are only
reserved if you include the header.

7.1.3 Reserved Identifiers
- Each identifier with file scope listed in any of the following
subclauses (including the future library directions) is reserved for
use as a macro name and as an identifier with file scope in the same
name space if any of its associated headers is included.


In n1124, section 7.13, it also says:
— All identifiers with external linkage in any of the following
subclauses (including the future library directions) are always
reserved for use as identifiers with external linkage.157)

So you can never use the names for functions unless you don't include
the relevant header *and* you declare the function as static.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Nov 15 '05 #20
Flash Gordon wrote:
In n1124, section 7.13, it also says:
— All identifiers with external linkage in any of the following
subclauses (including the future library directions) are always
reserved for use as identifiers with external linkage.157)

So you can never use the names for functions unless you don't include
the relevant header *and* you declare the function as static.


Since one header may #include another,
it might not be possible to tell which headers have been #included,
just by looking at the source.

--
pete
Nov 15 '05 #21
On Sat, 29 Oct 2005 17:21:13 GMT, in comp.lang.c , pete
<pf*****@mindspring.com> wrote:
Flash Gordon wrote:
In n1124, section 7.13, it also says:
— All identifiers with external linkage in any of the following
subclauses (including the future library directions) are always
reserved for use as identifiers with external linkage.157)

So you can never use the names for functions unless you don't include
the relevant header *and* you declare the function as static.


Since one header may #include another,
it might not be possible to tell which headers have been #included,
just by looking at the source.


Not relevant to the point. Also, ISTR that standard headers aren't
allowed to arbitrarily include each other.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 15 '05 #22
Mark McIntyre wrote:

On Sat, 29 Oct 2005 17:21:13 GMT, in comp.lang.c , pete
<pf*****@mindspring.com> wrote:
Flash Gordon wrote:
In n1124, section 7.13, it also says:
— All identifiers with external linkage in any of the following
subclauses (including the future library directions) are always
reserved for use as identifiers with external linkage.157)

So you can never use the names for functions unless you don't include
the relevant header *and* you declare the function as static.


Since one header may #include another,
it might not be possible to tell which headers have been #included,
just by looking at the source.


Not relevant to the point. Also, ISTR that standard headers aren't
allowed to arbitrarily include each other.


My recollection is only that there are some specific library functions,
which other library functions must act as though they do not call.

--
pete
Nov 15 '05 #23
Mark McIntyre <ma**********@spamcop.net> writes:
On Sat, 29 Oct 2005 17:21:13 GMT, in comp.lang.c , pete
<pf*****@mindspring.com> wrote:
Flash Gordon wrote:
In n1124, section 7.13, it also says:
— All identifiers with external linkage in any of the following
subclauses (including the future library directions) are always
reserved for use as identifiers with external linkage.157)

So you can never use the names for functions unless you don't include
the relevant header *and* you declare the function as static.


Since one header may #include another,
it might not be possible to tell which headers have been #included,
just by looking at the source.


Not relevant to the point. Also, ISTR that standard headers aren't
allowed to arbitrarily include each other.


True, but a programmer-supplied header can include a standard header.

For example, the following:

#include "foobar.h"
....
static void sin(char *s);
....
sin("gluttony");

is ok only if you can be sure that "foobar.h" doesn't directly or
indirectly include <math.h>.

I'd comment on whether that's relevant to the point if I were sure
what the point is. (That's not a request for information.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #24

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

Similar topics

12
by: Howard | last post by:
Hello everyone (total VB.NET beginner here), I'm reading the "SAMS Teach Yourself VB.NET In 21 Days" book, and came across an exercise that I can't get to work. The exercise asks that you create...
6
by: obdict | last post by:
Hello, I used scanf() in a while loop, which ensures that user input is valid (must be an integer no greater than 21 or less than 3). If user enters a number out of the range, or enters...
6
by: D | last post by:
I have a simple file server utility that I wish to configure as a Windows service - using the examples of the Python Win32 book, I configured a class for the service, along with the main class...
4
by: bjm | last post by:
I am writing a program that will automate a series of application installations. I want to give the user the option of stopping the program's execution in between installations (for example, give...
10
by: archana | last post by:
Hi all, I am having one windows service which is updating to database. On 'Onstop i want to wait till current updation complete. How will i do this? Because if i write some lengthy code on...
1
by: d0ugg | last post by:
Hi all, I have a little question, my compiler is giving me the following error: error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const...
12
by: beatjunkie27 | last post by:
I am working on a class assignment called Pennies for Pay the object of the program is to receive input for number of days worked. This should be > 0 and <= 40. An example output is below and...
2
by: Steve | last post by:
Hi All, I've been trying to come up with a good way to run a certain process at a timed interval (say every 5 mins) using the SLEEP command and a semaphore flag. The basic thread loop was always...
2
by: ocli5568 | last post by:
this main is supposed to receive user input (file names, flags and a keyword), then encrypt the file according to the user input, then close the file pointers. however it goes wrong for some reason....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.