Michal Seliga wrote:

> Luc Le Blanc wrote:
> > BTW, StrRchr doesn't exist. I have to write it too ;)

> should be StrChr, such exists

No because you have to find the last / in the pathname, so you need to start 
from the end, hence StrRChr. Here's my (yet) untested code:

Char *StrRChr( Char *string, Char chr )
{
    UInt16              i = StrLen( string );

    if ( i == 0 ) return NULL;

    Char               *c = &string[ i - 1 ];


    do
    {
        if ( *c == chr )
            return c;
        else
            c--;
    }
    while ( --i > 0 );

    return NULL;
}


Luc Le Blanc



-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to