Limiting the number of messages
- To: mathgroup at smc.vnet.net
- Subject: [mg103810] Limiting the number of messages
- From: Sean McConnell <smcconne at physi.uni-heidelberg.de>
- Date: Wed, 7 Oct 2009 07:02:25 -0400 (EDT)
Hi, I'm creating a program with procedures that often depend on sub-procedures. Many times I allow the sub-procedures to do the input checking, so I don't have to write a the same error trapping conditions and messages for each level of the program. The problem is however that although the 'input checking' is passed on to a sub-procedure, the main procedure continues to attempt to evaluate, and can usually return a very long list of error messages whilst it foolishly attempting to evaluate with improperly input variables. I would like to know how to make a procedure abort its evaluation after say 3 or so messages, and simply return the name of the procedure and the variables (as happens when you use /; for conditionals). I have tried the use of Check, and although it checks for messages, it will only return what is typed in to the space for a second argument (eg: Check[f[a], "problem"] will return simply "problem"), I would like to be able to tell the user how they have screwed up. Many thanks, Sean McConnell.