View Single Post
  #6  
Old August 16th 19, 03:37 PM posted to microsoft.public.windowsxp.general
Paul[_32_]
external usenet poster
 
Posts: 11,873
Default Pasting into DOS - slowing it down ?

R.Wieser wrote:
Steve,

I right-click on the blue bar at the top of the window, and
then click "Edit -- Paste"

Would that make a difference, or is it effectively the same
thing?


It looks very similar. I've tried it, but still lots of chars disappear.

Perhaps it could be a setting in the DOS program itself.


:-) The program in case is so old that it doesn't have any concept of
copy-pasting from/to other sources/targets.

Thanks for the suggestion though.

Regards,
Rudy Wieser


In things like C code, some people use a "flush" function
after gets() or similar. Which normally (when typing input)
is not a problem, as the user cannot possibly type fast enough
to "miss" a character because of the flush() call.

However, pasting into a window and converting a paste buffer
into a pipe to stdin, means the character stream is already
queued up. Then it's a race condition, between the system
loading the queue, and the DOS program (lightning fast)
trying to eat characters and interspersing the calls with
bogus flush().

I wrote some little five line program a month or two ago,
where I learned of the various possible implementations,
and I was using the wrong character input routine initially.
And settled on another function which didn't need flush for
consistency.

This could mean, if you don't have access to source, you might
not be able to correct the stdin behavior. It's not really
a "speed thing" in the conventional sense - the use of FIFO queuing
in a lot of file functions means (normally) the software
would never lose a thing. Calling flush() is just dumb in
a sense, bad juju as a programmer. It's just asking
for trouble. It might mean that only typed input allows
the race condition to be won in the DOS programs favor.

int m; /* this won't hiccup */
while ( (m = getch()) != 13 ) {
QueryPerformanceCounter((LARGE_INTEGER *)&time1); /* record time when key pressed */
/* do something with "m" */
}

In the case of pasted input, the "time" value might have
very small differences between each perceived character input.

Paul
Ads