Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!ucbvax!RITVAX.ISC.RIT.EDU!WKF2298 From: WKF2298@RITVAX.ISC.RIT.EDU (Wonko the Sane) Newsgroups: comp.sys.apple2 Subject: Protectin Portions of Memory in BASIC. . . Message-ID: Date: 9 Jan 91 17:00:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 34 Alas, I have been writing a large program and as I am approaching the end, strange things began to happen. Just for the sake of brevity, the program basically does a whole series of file manipulations to create a disk structure. To do this, a script is loaded and stored in the graphic page (which is not used) at $2000. The program had been working fine, but last evening I added a few more items to the end of the program. Suddenly, it started breaking down because the script had been overwritten at $2000 and of course, the program crashed. When I checked the location, the whole graphic page had been filled with the contents of a trivial little variable which was used once in the whole program; it repeated indefinitely. To fix it, immediately after the variable was used, I set it equal to "" and that seemed to solve the problem. Today, after adding yet another section to my program, a similar problem occurs where my scripts are being overwritten by garbage. What is really, really odd is that the program does not even run as far as the new material before it crashes! It overwrites almost instantly. Originally, I figured my variables were the culprit, but it doesn't go far enough for that to happen. Granted, the program contains an unbelievable amount of variables, but I frequently drop an x=fre(0) to run the garbage handling rountines. And it is not that my program is too long that it runs into the graphic page. Is there something more that I can check? I've never really familiarized myself with the HIMEM LOMEM commands, but is there something that I can do to isolate that portion of memory from being written to? Also, I may need to use the entire graphic page. . . is that too much to ask? :-) Thank you all very much in advance! I was hoping to have this finished for a project by next week, so any help would be greatly appreciated! Thank you. William K. Fry wkf2298@ritvax.isc.rit.edu