[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BASIC Question



Joe Walters (bird@MCS.COM) wrote:
: I'm in the process of modifying the BASIC program, "HOME ACCONTANT,"
: so it can be installed on a hard drive for a member of my Apple Club
: that uses this program quite a bit.

: Things are going somewhat well until I come to the BASIC file, MEMOS.
: It has the following lines:

: 10 GOSUB 60000

: 60000 *
: 60025 DATA LOTSA STUFF
: 60030 ** DATA MORE LOTSA STUFF

First of all, something stinks right there.  Is this what you are seeing
from Program Writer, or is this what is really on that line (i.e. what
Applesoft shows you)?  Since the line is called from line 10, there has to
be a valid token on that line, and "*" is not a valid Applesoft keyword. 
Well, it is, but by itself it should generate an error.  

: My problem is that I need to modify line 60000 from within Program
: Writer. When I try I'm told that the "Line is too long." Hard to
: believe that a single "*" is too long. What am I missing?

My experience with Program Writer has been very limited and most
definately negative.  Your mileage may vary.  Is it possible that Line
60000 contains a routine with more than 238 characters, which thus
overflows Program Writer's line buffer?  You can do that in Applesoft,
because a program line is of unlimited length...but the input buffer can
only handle up to 238 characters.  Because the input line is immediately
parsed by Applesoft and tokenized, the line can grow once Applesoft gets
hold of it...for instance, if you type...

]60000?CHR$(4);"OPEN FILE":FORX=0TO366:?CHR$(4);"WRITE FILE":?X;":":FORE=1TON
(X):?SPC(6);Q1$(X,E):NEXTE:?CHR$(4):NEXTX:?CHR$(4);"CLOSE":RETURN

If I counted right, that is 142 characters.  Applesoft will parse that as:
 60000 PRINT CHR$( 4);"OPEN FILE" : FOR X = 0 TO 366 : PRINT CHR$( 4);
   "WRITE FILE" : PRINT X; ":" : FOR E = 1 TO N(X) : PRINT SPC( 6);Q1$
   (X,E) : NEXT E : PRINT CHR$( 4) : NEXT X : PRINT CHR$( 4);"CLOSE" :
   RETURN

Which is only 100 *tokens*, but something like 212 characters depending on
how you count it.  If the line in question is way too long, perhaps
Program Writer is choking on it and can't even display it properly.

Take a look at it using Applesoft (LIST 60000) and see what you get.  You
might have to retype that line by hand from the Applesoft prompt, leaving
out all unnecessary spaces and replacing PRINT with ? wherever it appears.

Good luck...And let me know if I am on the right track...I am not terribly
familiar with Program Writer, and it is possible that you are running into
something completely different.

--Dave Althoff, ][.
(self-proclaimed Applesoft Ace) 
-- 
    /-\        _       _           ***  New season begins May 9!  ***
   /XXX\      /X\     /X\_      _     /XX\_      _     _        _____  
  /XXXXX\    /XXX\  _/XXXX\_   /X\   /XXXXX\    /X\   /X\      /XXXXX
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX