Path: ns-mx!uunet!cis.ohio-state.edu!ucbvax!cleveland.Freenet.Edu!as155 From: as155@cleveland.Freenet.Edu (Kyle Hasselbacher) Newsgroups: comp.sys.apple2 Subject: Hiding a BASIC listing. Message-ID: <9107170622.AA14971@cwns9.INS.CWRU.Edu> Date: 17 Jul 91 06:22:18 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: as155@cleveland.Freenet.Edu Lines: 44 In a previous article, lazer@lablues.UUCP (Patrick Delahanty) says: >Is there a way so that people cannot see the listing of my BASIC program? I >don't want people changing it! Try POKE 2051,255:POKE 2052,255. This will change the first line of your program (whatever the number is) to line number 65535--and BASIC only allows numbers up to 63999 (I think that's what it is), so this line can't be reedited. It's intended so that you enter a REM as the first line of your program (including your name, etc.), execute the POKEs, then the enter the rest of the program. That way, 65535 will be the last line, and it still can't be edited or removed. If you do this after the whole program is entered, none of it can be altered. The side effect is that if someone DOES try to change something, there will be two of the line they tried to change. One will be before the 65535 top line, and the original one below. That's bad, of course... And I can think of a couple ways of removing that line if necessary, and even one that you could do from BASIC...but, anyway. >I have taken care of the Control-Reset break with a POKE... You have an error-handling routine, right? Use ONERR GOTO, and check IF PEEK(222) = 255 to see if they tried a Control-C break. Also, if the computer is in FLASH mode when control-reset is hit, it will scramble the listing. But you've already taken care of control-reset... Do you have an END statement? You might think about making that NEW so they can't just list it after it's executed. Try this... 0 POKE 1010,102:POKE 1011,213:POKE 1012:112:ONERR GOTO 0 Now any attempt to break the program will result in it simply rerunning. If Control-C is tried, though, the variables will remain--you might want to put a CLEAR in there, and maybe NORMAL if you change video modes in the program. >-Lazer (Co-sysop L/A Blues and Apple ][ Programmer) I hope some of these ideas help... -- Kyle Hasselbacher, aka "Kyle Buddy (8-)" |Line noise? I don't have lin@$#w3| InterNet: as155@cleveland.freenet.edu |NO CARRIER | (faster): khassel@heartland.bradley.edu |----------------------------------| Prodigy: Yeah, right! | The egg came first. |