[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Applesoft limitation
On Nov 11, 3:49 am, "Michael J. Mahon" <mjma...@aol.com> wrote:
> mojoehand wrote:
> > I haven't done anything with Applesoft in many years. I was just
> > trying to do something simple and re-learned that Applesoft doesn't
> > have things that I am used to having in other BASICs. In particular, I
> > needed the INSTR() function, but it's not there. Short of using
> > another BASIC or even another language, is there some "enhancement"
> > software to add INSTR() and such to Applesoft? Or, is there any way to
> > fake this function in standard Applesoft?
>
> I've learned to try not to "need" this function. ;-)
>
> When it cannot be avoided, you have at least three choices:
>
> 1. Assembly code (there are almost certainly some INSTR ampersand
> or USR commands out there...)
>
> 2. Direct implementation in Applesoft using MID$--not hard, but
> pretty slow (OK if you don't use it too often).
>
> 3. An intermediate approach using the DATA statement scanner to
> collect "tokens" for comparison and use.
>
> The third approach is several times faster than 2), but still
> quite slow compared to 1). My File Server for NadaNet uses
> this approach to do lexical scanning of request strings:
>
> http://home.comcast.net/~MJMahon/FileServer.html
>
> -michael
I was surprised to see Applesoft didn't have this. It was one of the
most-used functions when I programmed in TI Basic on my 99/4A. Great
for searching files...
Not wanting to get trashed, so I will say that if you implement #2 in
Applesoft, the resulting program would probably STILL be faster than
TI Basic due to the slow speed of the latter...
[I have a great respect for the Apple II line, and still have a couple
of IIe's and a IIc. What I *didn't* like was the snotty attitude of
the local Apple users at my high school (circa 1982). Especially the
computer science instructor.]
Found out what a dumb*ss he was when I found him with a Corvus hard
drive taken apart, and he was using Windex and those rough brown paper
towels from the restroom to clean the platters he'd taken out of the
drive...