TIP: Click on subject to list as thread! ANSI
echo: apple
to: comp.sys.apple2
from: Michael J. Mahon
date: 2008-11-11 00:49:22
subject: Re: Applesoft limitation

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

******** Note new website URL ********

NadaNet and AppleCrate II for Apple II parallel computing!
Home page:  http://home.comcast.net/~mjmahon/

"The wastebasket is our most important design
tool--and it's seriously underused."
--- SBBSecho 2.12-Win32
* Origin: Derby City Gateway (1:2320/0)
SEEN-BY: 10/1 3 34/999 120/228 123/500 140/1 222/2 226/0 236/150 249/303
SEEN-BY: 250/306 261/20 38 100 1404 1406 1410 1418 266/1413 280/1027 320/119
SEEN-BY: 393/11 396/45 633/260 267 712/848 800/432 801/161 189 2222/700
SEEN-BY: 2320/100 105 200 2905/0
@PATH: 2320/0 100 261/38 633/260 267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.