Re: sethandler() help please
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Sep 04, 2003
- 411 views
On Thu, 4 Sep 2003 03:28:04 +0000, David Davis <gdavis at hypercon.net> wrote: Derek's answer is correct. I also noticed the following line (which Derek replaced, so it makes no difference now): >routine_id("Save_Button_OnClick")}) .. >procedure Save_Button_onClick(integer self, integer event, sequence=20 Of course routine_id is case sensitive. I always wrap routine_id, eg: function routineid(sequence name) integer r r=3Droutine_id(name) if r=3D-1 then ?9/0 end if return r end function so it fails a bit more obviously. However, you do need to make sure this is right at the end of the code, after all the routines it will reference and before the bank of setHandler etc calls, or, sometimes more bizarrely, call it via r_routineid=3Droutine_id("routineid") I hope that makes sense. Although it can be quite confusing at first, it has made my code much more maintainable. Regards, Pete PS No, I still can't think of a case where you'd pass routine_id an unrecognised string and want it to return -1 quietly instead of stopping with an error. Rob claims it would break existing code.