HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- How do you set up CNTRL Y that has a normal exit w...
Operating System - OpenVMS
1833130
Members
3426
Online
110051
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 01:30 AM
09-07-2005 01:30 AM
This is what I have tried:
set control=y
...
on control_y then goto end
...
end:
exit
Why does this not work?
Shouldn't "on control_y then goto end" work no matter where I put it in the code?
set control=y
...
on control_y then goto end
...
end:
exit
Why does this not work?
Shouldn't "on control_y then goto end" work no matter where I put it in the code?
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 02:00 AM
09-07-2005 02:00 AM
Solution
Kenneth,
I dont know what you mean with
"Shouldn't "on control_y then goto end" work no matter where I put it in the code?"
A simple test procedure:
$ set control=y
$ write sys$output "before on_control"
$ wait 00:00:30
$ on control_y then goto end
$ write sys$output "after on_control"
$ wait 00:00:30
$ exit
$end:
$ write sys$output "ctrl y pressed"
$ exit
If you press before "after on_control" is displayed on the terminal the procedure will be terminated without going to the end label. If you press after the "after on_control" display, you will receive the "ctrl y pressed" on your terminal.
The on control command establish a handler for the, so the command will be executed only if you press after the on control command.
Bojan
I dont know what you mean with
"Shouldn't "on control_y then goto end" work no matter where I put it in the code?"
A simple test procedure:
$ set control=y
$ write sys$output "before on_control"
$ wait 00:00:30
$ on control_y then goto end
$ write sys$output "after on_control"
$ wait 00:00:30
$ exit
$end:
$ write sys$output "ctrl y pressed"
$ exit
If you press
The on control command establish a handler for the
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 01:26 PM
09-07-2005 01:26 PM
Re: How do you set up CNTRL Y that has a normal exit when operator executes CNTRL Y
Kenneth,
Where doesn't it work?
DCL is interpretive, so the ON condition only takes effect AFTER it is executed. Unlike "ON condition", which is a "one shot", ON CONTROL_Y remains in effect until it's changed. Beware that this can get you into unbreakable loops. You should probably put another ON CONTROL_Y after label "end" if you want to do something other than loop back to the label.
BTW, I'd also recommend against using "end" as a label name. The DCL interpreter can get confused with labels that are the same, or even similar to, some DCL commands, ESPECIALLY "structural" commands like IF, THEN, ELSE, ENDIF, SUBROUTINE, RETURN, EXIT etc...
Note that MOST of the time this doesn't matter, but in obscure cases it's been known to cause trouble, so it's just a good programming practice to avoid the possibility.
Where doesn't it work?
DCL is interpretive, so the ON condition only takes effect AFTER it is executed. Unlike "ON condition", which is a "one shot", ON CONTROL_Y remains in effect until it's changed. Beware that this can get you into unbreakable loops. You should probably put another ON CONTROL_Y after label "end" if you want to do something other than loop back to the label.
BTW, I'd also recommend against using "end" as a label name. The DCL interpreter can get confused with labels that are the same, or even similar to, some DCL commands, ESPECIALLY "structural" commands like IF, THEN, ELSE, ENDIF, SUBROUTINE, RETURN, EXIT etc...
Note that MOST of the time this doesn't matter, but in obscure cases it's been known to cause trouble, so it's just a good programming practice to avoid the possibility.
A crucible of informative mistakes
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP