Hi,
I am interested on this issue so I gived a try to a duplicated 'file_asc_read' reading the file short by short. It moves the read pointer same as 'file_find'.

Code:
short *short_from_char ( short *_s, char *_chr )
{
	short *_sT = _s;
	for ( ; *_chr!=NULL; _chr++ )
	{
		*_sT = *_chr;
		_sT ++;
	}
	*_sT = NULL;
	return _s;
}

BOOL _ffu_rec ( var _hdlFile, short *_s )
{
	if ( *_s == NULL )
		return TRUE;
	char _chr[2];
	_chr[0] = file_asc_read ( _hdlFile );
	_chr[1] = file_asc_read ( _hdlFile );
	if ( *_s != *((short*)_chr) )
		return FALSE;
	if ( _ffu_rec ( _hdlFile, ++_s ) )
	{
		file_seek ( _hdlFile, -2, 1 );
		return TRUE;
	}
	else
	{
		file_seek ( _hdlFile, -2, 1 );
		return FALSE;
	}
}

int file_findw ( var _hdlFile, char *_chrText )
{
	short _sText[32];
	short_from_char ( _sText, _chrText );
	file_seek ( _hdlFile, 0, 0 );
	int _iLength = file_length ( _hdlFile );
	int _iPos = 0;
	for ( ; _iPos<_iLength; _iPos+=2 )
	{
		if ( _ffu_rec ( _hdlFile, _sText ) )
			return _iPos;
	}
	return -1;
}



Salud!

Last edited by txesmi; 02/15/17 06:05.