Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accept with timeout not kicking in after initial input

Status
Not open for further replies.

fschaafsma

Programmer
Oct 30, 2011
3
EU
Hi,

I have a 13 position wide accept with a timeout (ACCEPT CUS-NUM LINE 12 COL 10 TIME 5000 ON EXCEPTION….). This timeout is crucial as I want the program to terminate if there is no keyboard input for a defined period of time.

This all works great as long as the user does nothing. The moment the user enters a single character the timeout is cancelled and the program will no longer terminate.

Is there a way to solve this? I have considered using a loop of 13 single one character accepts but then I get stuck with the backspace – afaik this won’t raise an exception – not working anymore.

Anyone any ideas? I am using RM Cobol v11/v12.

Thanks in advance,
Fred
 
Why is this functionality needed? If the user begins an entry and then is distracted, why can they not simply continue later?

Is there some reason that the user could not key in the 13 bytes which would automatically proceed or key less than 13 and press Enter (or whatever)?

 
Hi papadba,

Securitu reasons. The program needs to exit but users don't like loging on again so they 'sabotage' the accept by entering a single character.

Regards,
Fred
 
Fred,

You can configure the keys to do just about anything you want. See Chapter 10 of the RM/COBOL User's Guide. However, the configuration affects the entire run unit. But you can get an exception code when you press backspace in the leftmost character position. From Chapter 10:
BACKSPACE. The BACKSPACE value accomplishes a destructive backspace by moving the cursor left one position in the field, deleting the character at that position, moving all following characters left one position, and inserting a prompt character at the right end of the screen field. If entered in the leftmost position of the screen field, the key sequence is treated as a field termination key or as an illegal keystroke depending on
whether an exception status value has been assigned to the key sequence.

Tom Morrison
Micro Focus
 
Tom,

Thanks for the info. I'll be digging through the user guide then and find out what the impact on the rest of the program will be.

Regards,
Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top