Jump to content


  • Posts

  • Joined

  • Last visited

zerothis's Achievements


Newbie (1/14)



  1. I never tried to make BASIC fast. I just tried to make games that didn't require speed For speed I used C or Pascal.
  2. Yes, I remember renumbering programs from back in the day. I figured I could do that at some point;perhaps there's even modern document macro to get it done. But, I'm working with several separate code documentations that extensively references the line numbers. A renumbering program that can simultaneously 'renumber' word docs, HTML docs, text files, and emails would be a really neat trick.
  3. Thank you all for the help. I've learned a lot more that need just to fix this one issue, and that's good. When I traced the code, I released than the "NO" option was GOTOing (eventually) to the GOSUB that I was GOTOing out of. I was stacking the same GOSUB over and over. rje, wow! that code is very close to a subroutine of the code I can't reveal at this time but line 650, as mentioned, is outside of this subroutine. The code I'm working on is more spaghettified than anything I ever managed to do myself, and that's saying something. And it is over 400 lines now. Also, most lines are sequential leaving very little room to insert lines without renumbering the entire mess. I was hoping to make some small changes to fit it into x16 BASIC and the 80 character line limit. So the original author could recognize it even after the conversion. But, now that I know about the BASIC stack, I'm not sure this is an option. I should mention, the original author's version is bug free. I'm the one to blame for moving a segment into a subroutine and thinking I could get away with a GOTO. My my computer teachers always scolded me for using GOTO without fully explaining why. Now I understand, it not just about readability, GOTOs can actually break a program.
  4. Warning: I'm new to Commodore/Commander x16 BASIC. And 35 years out of practice in BASIC. And never really that advanced to begin with. And, I'm working on someone's else's code that I cannot make public at this time. I have a linear array of 6 values. The code uses FOR-NEXT to fill all 6 values with a random integer between 3 and 25. The square root of the RND value is calculated before being being multiplied (in case that makes a difference) . The screen is cleared then the values are printed on screen and the user is prompted (GET B$) to accept them or choose 6 new random values. If the user reject them, then the program goes back to the FOR-NEXT loop to create 6 new values. Problem is, if they reject the values 19 times, the program crashes with "?OUT OF MEMORY ERROR IN 650 (the line with the FOR-NEXT and RND). I can use CLR before the FOR-NEXT; no OOM error. But this borks all the arrays in the program that are filled using DATA statements. The FRE(0) function seems like it is applicable I cannot understand how to use it to clear out the array (if that is what causes the OOM)?
  • Create New...

Important Information

Please review our Terms of Use