home *** CD-ROM | disk | FTP | other *** search
/ Futura 12 / Futura_Issue_12_1994_03_NOSAUG_Side_A_BASIC.atr / undoing.doc < prev    next >
Text File  |  2023-02-26  |  2KB  |  1 lines

  1. ¢UNDOING THE BASIC GARBAGE QUIRK¢A mini-tutorial by Les Wagar¢¢    Have you ever noticed that your Basic programs seem to get bigger all by themselves, taking up one or several sectors more disk space than they used to?  Take VIEWDOCS.BAS on Futura issue 11, for instance.  It takes up 24 sectors--but without changing one byte of the program as written, it should take up 22 sectors.¢¢    The quirk is not in the program.  The quirk is a bug in the SAVE procedure.  If you have been working on a program--adding, deleting, whatever--or been working in ΘϕϕσΣΘβ⌠σ ϕ∩Σσ with the program installed, and then proceed to SAVE the program, you have likely added garbage data to your program.  The variable list, for instance, will still include any variables which you have deleted from the program or have otherwise played around with.  The simple solution to the problem is:  don't SAVE, LIST.¢¢    To SAVE a clean version of VIEWDOCS.BAS, enter commands in ΘϕϕσΣΘβ⌠σ ϕ∩Σσ as follows:¢¢      1. LIST "D?:VIEWDOCS.LST¢      2. NEW¢      3. ENTER "D?:VIEWDOCS.LST¢      4. SAVE "D?:VIEWDOCS.BAS¢¢Your BAS version now takes up 22 sectors.  You have removed the garbage.¢¢    Note in passing that your LST version takes up only 18 sectors, and you may well ask why your BAS version is still taking up 4 more sectors than it possibly could.¢¢    There's an answer to that question, too, but now you've got to look hard at the program itself.  How many times do you repeat numbers that could be replaced by a variable?  If a number is repeated more than twice, replace it with a letter.  Let A=1, B=2, C=0, D=3, etcetera, replace the numbers accordingly, and (lo and behold!) your SAVE after a LIST is now getting close to 18 sectors--if not bang on!¢¢    But be careful, of course.  When you start revising a program, be sure a working version is tucked away somewhere out of reach.¢¢    Have fun!¢