//flex table opened by JP

Click to See Complete Forum and Search --> : COBOL (I know, I know...)


shiva_42
01-07-2003, 03:42 PM
Is there anyone out there old enough to remember how to do a simple "delay" loop in a COBOL language program? I need to display a simple text message (copyright notice) on screen for a few seconds, but apparently there isn't a "wait" or "pause" command in COBOL. Any takers?

:p

P.S. I specifically DON'T want the user to have to press a key to get beyond this display screen.

AltatemTC
01-08-2003, 07:52 AM
Who you calling old? :-)

ON 1 EVERY 1 UNTIL 1000000
DO SOMETHING.

Replace the "do something" with an operation that will take some time. I'm sure there are other ways to do it as well. You might also try capturing the time and checking for a number of seconds to pass. I don't remember the time functions.

shiva_42
01-08-2003, 12:19 PM
Well... I'll try it, but I've never seen the ON command in my version of COBOL (Ryan/McFarland [RM], now distributed by Liant...this is a PC version).

This approach would be CPU timing dependent, and I'm hoping to find a timing-independent method for consistancy. I'm not familiar with the "time" function either, but will research further. Thanks for the info so far!

:t

shiva_42
01-09-2003, 04:27 PM
Thanks for the feedback:

As it turns out, my brand of COBOL has a new parameter for the ACCEPT statement (waiting for a keyboard input), which allows a timeout increment to be used... I had to upgrade to a newer version compiler to use it, but it works great. In essence the command is:

ACCEPT variable LINE xxx COL xxx BEFORE TIME variable/literal

This is timing independent, and accomplished exactly what I was hoping for.


__________________
shiva@priest.com

qball
01-09-2003, 10:21 PM
just curious,

but, what happens if kb input occurs before timeout?

shiva_42
01-10-2003, 12:50 PM
If keyboard input occurs before timeout, the keyboard input is accepted.

In this specific case, all I was wanting to do was to insure that a copyright notice was displayed for a reasonable amount of time before the menu loaded. Obviously, if they press a key quickly enough, they can almost circumvent the copyright notice, but the way copyright regs are written, this wouldn't matter, as they would intrinsically have to look at the monitor to know that a message existed.

I suppose, if you wanted to put a little extra work into it, that you could only allow a specific character to pass the filter (like a high-order ASCII value) which would prevent the ACCEPT statement from terminating without the PROPER character being input, but my needs weren't anywhere near this complex for the moment.

qball
01-10-2003, 09:49 PM
this is harsh...


but it works great


No, it doesn't. You even state easily circumvented...

Not sure how much the users will appreciate:


In this specific case, all I was wanting to do was to insure that a copyright notice was displayed for a reasonable amount of time before the menu loaded.


unless of course you tell them to hit 'any', whoops, 'a' key, ...key, and then you can see menu.


Obviously, if they press a key quickly enough, they can almost circumvent the copyright notice, but the way copyright regs are written, this wouldn't matter, as they would intrinsically have to look at the monitor to know that a message existed.


In that case, they 'intrinsically' accept the copyright, by using/choosing menu/choice, so:

no need to show!

your logic is difficult to follow, but, what's the copyright for anyway?