Path: utzoo!attcan!uunet!mcvax!hp4nl!uva!borton From: borton@uva.UUCP (Chris Borton) Newsgroups: comp.sys.mac.hypercard Subject: on idle "backgrounding" & switch{}/CASE Message-ID: <570@uva.UUCP> Date: 18 Nov 88 17:33:23 GMT Reply-To: borton@uva.UUCP (Chris Borton) Organization: Faculteit Wiskunde & Informatica, Universiteit van Amsterdam Lines: 32 Scenario: I've got one stack full of information cards on various geographical locations in different fields. A different stack, "Tester" goes to the "Geography" stack and pulls pairs of fields at random to make a match-the-pairs test. Currently I have this done all at once via a button. The complaint from the students is that this takes awhile. I agree, and have optimized it as much as I can, I think. However, ideally I'd like to do the whole process 'in the background' while they are busy thinking about the current test. I don't think this would be too hard, using an 'on idle' handler, but my question is how to best implement it. My initial thought is the have the idler increment a variable and call a function with that variable, which would tell it what to do. Breaking the test-building process into chunks and doing them according to the number passed seems fine; where the problem comes in is how to deal with the number coming in and what to do--a CASE statement in Pascal, switch{} in C. As far as I can tell, there is no clean way to do this in HyperTalk other than ungainly masses of if/then levels. If there is no better way, then I'll probably end up doing that at several levels. But I'd rather not. Can anyone shed light on this? Better solutions? Thanks... -cbb -- Chris Borton borton%uva@mcvax.{nl,bitnet,uucp} Rotary Scholar, University of Amsterdam CS Now Palestine is a virtual country. But what gets swapped out on page-fault?