Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!hagbard!sunic!kth.se!news From: lennartb@lne.kth.se (Lennart Boerjeson @ KTH/LNE, The Royal Inst. of Tech.) Newsgroups: comp.sys.handhelds Subject: Re: BREAK and RETURN on the 48sx: where are they? Message-ID: <00941516.C03464A0@lne.kth.se> Date: 17 Dec 90 09:57:15 GMT References: <8601@dog.ee.lbl.gov> Sender: news@kth.se (News Administrator) Reply-To: lennartb@lne.kth.se (Lennart Boerjeson @ KTH/LNE, The Royal Inst. of Tech.) Organization: KTH, Royal Institute of Technology, School of Electrical Engineering Lines: 43 In article <8601@dog.ee.lbl.gov>, austern@ux5.lbl.gov (Matt Austern) writes: >As far as I can tell, the HP 48 doesn't provide any way to break out >of a loop in the middle (in C, break), and doesn't provide any way to >return from a function anywhere but the end. (in C, return). Yes, I >know that it's always possible to avoid using these if you put in an >extra test or flag, but sometimes they are convenient. > >Am I missing something very basic? Or if there really is no break or >return, has anyone out there found a good kludge to simulate them? >-- >Matthew Austern austern@lbl.bitnet Proverbs for paranoids, 3: If >(415) 644-2618 austern@ux5.lbl.gov they can get you asking the wrong > austern@lbl.gov questions, they don't have to worry > about answers. I usually do that by surrounding the code I might want to break out of with an IFERR. Then I can 'break' out with a DOERR call. E.g: IFERR ... DO .... .... .... "BREAK" DOERR .... .... UNTIL ... END THEN IF ERRM "BREAK" SAME NOT THEN @ Was it 'break' ? @ ERRN DOERR @ No, resignal error @ END END !++ ! Lennart Boerjeson, System Manager ! School of Electrical Engineering ! Royal Institute of Technology ! S-100 44 Stockholm, Sweden ! tel: int+46-8-7907814 ! Internet: lennartb@lne.kth.se !--