[Coco] "C string searching question

Bill Pierce ooogalapasooo at aol.com
Tue Oct 2 01:22:20 EDT 2012


This is why I was doing byte by byte search... find fist char, then match 2nd, ?no match? move to next char in string and start over. I had it working just doing first word search, then started editing the code to move through the string for any occurance and got it messed up. Now I can't seem to get it back to the working version... and by the way, it was pretty fast through almost 200 songs. I didn't try any higher counts yet.

Bill P

Music from the Tandy/Radio Shack Color Computer 2 & 3
https://sites.google.com/site/dabarnstudio/
Bill Pierce
ooogalapasooo at aol.com




-----Original Message-----
From: Retro Canada <retrocanada76 at gmail.com>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Tue, Oct 2, 2012 1:16 am
Subject: Re: [Coco] "C string searching question


damn touchscreen well try to build some hash list or ant other shortcut 
algorithm O(x^2) will seem pretty good with 100 entries bad with 200 and come 
back tomorrow after i finish to search 500*500 strings :P

Sent from my iPhone

On 2012-10-02, at 1:06 AM, Bill Pierce <ooogalapasooo at aol.com> wrote:

> 
> Mark,
> I just did some searching through klib.l manual and the string functions there 
are:
> 
> strcat, strucat, strncat, strcmp, strucmp, strncmp, struncmp, strcpy, strucpy, 
strncpy, strlen, strchr, strrchr, strpbrk, strspn, strcspn, strtok, strclr, 
strend, reverse, pwcryp, index, rindex
> 
> there's no strstr.
> 
> Bill P
> 
> Music from the Tandy/Radio Shack Color Computer 2 & 3
> https://sites.google.com/site/dabarnstudio/
> Bill Pierce
> ooogalapasooo at aol.com
> 
> 
> 
> 
> -----Original Message-----
> From: Mark McDougall <msmcdoug at iinet.net.au>
> To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
> Sent: Tue, Oct 2, 2012 12:37 am
> Subject: Re: [Coco] "C string searching question
> 
> 
> On 2/10/2012 2:01 PM, Bill Pierce wrote:
> 
>> <I don't suppose you have access to library functions like strlen() and
>> <strchr() and strstr() in that context, do you?
>> 
>> Yes, they are supported. 
> 
> Replace the inner loop with:
>  if (strstr (records[cnt].recname, srchstr))
> 
> Regards,
> 
> -- 
> |              Mark McDougall                | "Electrical Engineers do it
> |  <http://members.iinet.net.au/~msmcdoug>   |   with less resistance!"
> 
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
> 
> 
> 
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco

--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco

 



More information about the Coco mailing list