Yes it would be good. Is this what you had in mind?: --- METHOD findText( cText, nPos, lCaseSensitive, lExact ) CLASS LISTBOX
LOCAL nPosFound LOCAL nPass LOCAL nPasses LOCAL nSize LOCAL lOldExact IF !ISCHARACTER( cText ) RETURN 0 ENDIF IF !ISNUMBER( nPos ) nPos := 1 ENDIF IF !ISLOGICAL( lCaseSensitive ) lCaseSensitive := .T. ENDIF IF !lCaseSensitive cText := Lower( cText ) ENDIF DEFAULT lExact TO Set( _SET_EXACT ) nSize := Len( ::aItems ) - nPos + 1 nPasses := iif( nPos > 1, 2, 1 ) IF lExact FOR nPass := 1 TO nPasses IF ( nPosFound := AScan( ::aItems, iif( lCaseSensitive,; { | aItem | aItem[ _ITEM_cTEXT ] == cText },; { | aItem | Lower( aItem[ _ITEM_cTEXT ] ) == cText } ), nPos, nSize ) ) > 0 EXIT ENDIF nSize := nPos - 1 nPos := 1 NEXT ELSE FOR nPass := 1 TO nPasses /* NOTE: Intentionally using "=" comparison to honor the _SET_EXACT setting. */ IF ( nPosFound := AScan( ::aItems, iif( lCaseSensitive,; { | aItem | aItem[ _ITEM_cTEXT ] = cText },; { | aItem | Lower( aItem[ _ITEM_cTEXT ] ) = cText } ), nPos, nSize ) ) > 0 EXIT ENDIF nSize := nPos - 1 nPos := 1 NEXT ENDIF RETURN nPosFound METHOD findData( cData, nPos, lCaseSensitive, lExact ) CLASS LISTBOX LOCAL nPosFound LOCAL nPass LOCAL nPasses LOCAL nSize LOCAL lOldExact IF !ISCHARACTER( cData ) RETURN 0 ENDIF IF !ISNUMBER( nPos ) nPos := 1 ENDIF IF !ISLOGICAL( lCaseSensitive ) lCaseSensitive := .T. ENDIF IF !lCaseSensitive cData := Lower( cData ) ENDIF DEFAULT lExact TO Set( _SET_EXACT ) nSize := Len( ::aItems ) - nPos + 1 nPasses := iif( nPos > 1, 2, 1 ) IF lExact FOR nPass := 1 TO nPasses IF ( nPosFound := AScan( ::aItems, iif( lCaseSensitive,; { | aItem | _LISTBOX_ITEMDATA( aItem ) == cData },; { | aItem | Lower( _LISTBOX_ITEMDATA( aItem ) ) == cData } ), nPos, nSize ) ) > 0 EXIT ENDIF nSize := nPos - 1 nPos := 1 NEXT ELSE FOR nPass := 1 TO nPasses /* NOTE: Intentionally using "=" comparison to honor the _SET_EXACT setting. */ IF ( nPosFound := AScan( ::aItems, iif( lCaseSensitive,; { | aItem | _LISTBOX_ITEMDATA( aItem ) = cData },; { | aItem | Lower( _LISTBOX_ITEMDATA( aItem ) ) = cData } ), nPos, nSize ) ) > 0 EXIT ENDIF nSize := nPos - 1 nPos := 1 NEXT ENDIF IF lOldExact != NIL Set( _SET_EXACT, lOldExact ) ENDIF RETURN nPosFound --- Brgds, Viktor On Wed, Feb 18, 2009 at 1:36 PM, Przemyslaw Czerpak <dru...@acn.waw.pl>wrote: > On Tue, 17 Feb 2009, vszak...@users.sourceforge.net wrote: > > Hi Viktor, > > > Log Message: > > ----------- > > 2009-02-18 00:19 UTC+0100 Viktor Szakats (harbour.01 syenar hu) > > * source/rtl/listbox.prg > > ! Restored _SET_EXACT dependent code parts to have the > > same logic as before my modifications a few years ago. > > Przemek, is it right now? I honestly didn't understand > > the issue here. > > I suggest to fully remove _SET_EXACT modifications and replace it > by own code which will work respecting _SET_EXACT setting. I'll > try to make it. > > best regards, > Przemek > _______________________________________________ > Harbour mailing list > Harbour@harbour-project.org > http://lists.harbour-project.org/mailman/listinfo/harbour >
_______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour