Groups
Conversations
All groups and messages
Send feedback to Google
Help
Sign in
Groups
comp.lang.mumps
Conversations
About
Traps as exceptions
45 views
Skip to first unread message
Jens Lideström
unread,
May 13, 2022, 3:21:11 AM
5/13/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Link
Report message as abuse
Sign in to report message as abuse
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello, mumpstereers
The trap mechanism in Mumps has similarities with the exception mechanism in many other language.
Most examples I have seem of trap usage is for catching unintentional errors.
Is there also a way intentionally trigger an error, which can be caught by a trap, in a way that is similar to throwing an exception?
I am working with GT.M V7.0.
I’m learning about traps from here:
http://tinco.pair.com/bhaskar/gtm/doc/books/pg/UNIX_manual/ch13s06.html
This question is cross-posted on Stack Overflow:
https://stackoverflow.com/questions/72215952/traps-as-exceptions
K.S. Bhaskar
unread,
May 13, 2022, 7:22:51 AM
5/13/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Link
Report message as abuse
Sign in to report message as abuse
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Jens, does ZMESSAGE (
https://docs.yottadb.com/ProgrammersGuide/commands.html#zmessage
) help?
Regards
– Bhaskar
ed de moel
unread,
May 13, 2022, 7:55:37 AM
5/13/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Link
Report message as abuse
Sign in to report message as abuse
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
See also:
http://71.174.62.16/Demo/AnnoStd?Frame=Main&Page=a106012&Edition=1995
As an example, you could code:
Set a=1 Set $Ecode=",U123," Set b=2
Setting the value of $ECode triggers an error, and the Set b=2 would never be reached.
Hope this helps,
Ed
Jens Lideström
unread,
May 13, 2022, 8:58:09 AM
5/13/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Link
Report message as abuse
Sign in to report message as abuse
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Thanks Ed and Bhaskar!
ZMESSAGE and $Ecode are exactly the mechanisms I was looking for.
I don't understand how I could have missed them in the manual. I will investigate them.
Reply all
Reply to author
Forward
0 new messages