Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!unmvax!charon!hydra.unm.edu!stone From: stone@hydra.unm.edu (Andrew Stone CS.DEPT) Newsgroups: comp.sys.mac.hypercard Subject: MacTutor Popup menu bug fix Keywords: HyperChat(T), PopUPmenu, Minsky Message-ID: <4314@charon.unm.edu> Date: 30 Jan 89 16:15:54 GMT Sender: root@charon.unm.edu Reply-To: stone@hydra.unm.edu (Andrew Stone CS.DEPT) Organization: University of New Mexico, Albuquerque, NM Lines: 26 In January's MacTutor, Fred Stauder, on page 68-69 presents a very nice hypertalk pop-up menu. It needs one extra line of code to be thoroughly robust: the last expression of the following line of code can sometimes return -1, and then totally confuse the interpretator: select char offset(line sel of me,me) to (offset(line sel+1 of me,me) of me When choosing the second to last item in the list, the script can crash and produce the following error message: 'Expected unsigned integer but found "(".' To "head off the bug" simply insert this test before that line: if (offset(line sel + 1 of me ,me)-1) <0 then next repeat Thanks, Fred, for the fine ideas! Are you on this net, or does anyone have a path to him? andrew ||<<++>>||<<-->>||<<==>>||<<++>>||<>||<<++>>||<<-->>||<<==>>||<<++>>|| || || || || Andrew Stone ?? 2 + 2 = 5; || || stone@hydra.unm.edu <> for sufficiently large 2 || || || || ||<<++>>||<<-->>||<<==>>||<<++>>||<>||<<++>>||<<-->>||<<==>>||<<++>>||