Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!njin!princeton!phoenix!bskendig From: bskendig@phoenix.Princeton.EDU (Brian Kendig) Newsgroups: comp.sys.mac.hypercard Subject: Re: How do I reliably set the userLevel of a stack ? Message-ID: <9719@phoenix.Princeton.EDU> Date: 2 Aug 89 14:09:41 GMT References: <113@citycs.UUCP> Reply-To: bskendig@phoenix.Princeton.EDU (Brian Kendig) Organization: Systems Engineering, NASA Space Station Freedom Project Lines: 52 In article <113@citycs.UUCP> luke@ (Luke Whitaker) writes: >I have a problem that seems very trivial but I can't figure out. I want to >set userLevel to 1 when my stack starts up. Sounds simple. I tried putting >a "set userLevel" command in the "openStack" handler, and that's fine if my >stack is started from another stack. > >However, if it is double clicked from the finder, then my openStack routine >gets called, and THEN startup gets called, which goes all the way to the home >stack and resets the userLevel to whatever is in the user preferences card. If the person who uses the stack knows how to change the userLevel in the User Preferences card of the home stack, and if he actually felt like doing so, then he probably is intelligent enough to go through your stack without mucking it up terribly. You should assume that if he changed the userLevel to a level higher than "Browsing", he had a reason for doing so. If you still feel like being safe, however, there are two ways to go about keeping the userLevel at 1. You could simply do on idle set the userLevel to 1 end idle Blunt, but effective; unfortunately, you'd never be able to leave that level until you left the stack. For your own benefit you might change that command to 'if the commandKey is down then set the userLevel to 5 else set the userLevel to 1'. It's up to you. If you wanted to get tricky, you could try putting this in your stack script: on startUp send 'startUp' to first card of home set the userLevel to 1 end startUp This script should trap the startUp message, pretend to take care of it normally, but then set the userLevel correctly just before it exits. It should work as advertised, but since I don't have Multicrasher running on my 1M Mac, I can't test it right now. Good luck! >Luke Whitaker, Computer Science, City University, London, EC1V OHB, England. >JANET: l.whitaker@uk.ac.city.cs BITNET: l.whitaker%uk.ac.city.cs@ac.uk >ARPA: l.whitaker@cs.city.ac.uk (or l.whitaker%uk.ac.city.cs@nss.cs.ucl.ac.uk) >Uucp: ...!mcvax!ukc!citycs!luke (or luke@citycs.uucp) -- | Brian S. Kendig | I feel more like I | bskendig | | Computer Engineering | did when I got here | @phoenix.Princeton.EDU | | Princeton University | than I do now. | @PUCC.BITNET | | Systems Engineering, NASA Space Station Freedom / General Electric WP3 |