cs_morinxav2
Messages postés67Date d'inscriptionmercredi 30 juin 2004StatutMembreDernière intervention 6 octobre 2011
-
8 janv. 2008 à 16:11
yannfrance
Messages postés48Date d'inscriptionmardi 18 septembre 2007StatutMembreDernière intervention 1 décembre 2010
-
7 mai 2009 à 17:42
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.
yannfrance
Messages postés48Date d'inscriptionmardi 18 septembre 2007StatutMembreDernière intervention 1 décembre 2010 7 mai 2009 à 17:42
merci beaucoup pour ce source, elle m'as tres bien servi.
Ca merite la note maxi...
cs_morinxav2
Messages postés67Date d'inscriptionmercredi 30 juin 2004StatutMembreDernière intervention 6 octobre 20114 8 janv. 2008 à 16:11
Bonsoir,
super cela m'a economisé quelques nuits de sommeil !!
juste deux fonctions supplèmentaires pour completer ton travail :
{-----------------< FUNCTION Cherche_ListBox_Suivant >-------------------}
function Cherche_ListBox_Suivant(Chaine : string ; ListBox : TListBox) : Integer;
var
Index : integer;
CurrentItem : string;
begin
Result := -1;
Chaine := UpperCase(Chaine);
for Index := listbox.ItemIndex+1 to ListBox.Items.Count - 1 do
begin
CurrentItem := UpperCase(ListBox.Items.Strings[Index]);
//AddError(IntToStr(Index) + ' WinText : ' + Chaine + ' Nb Sous Chaine : ' + IntToStr(NbSousChaine(Chaine, CurrentItem)));
//AddError(Chaine + ' - ' + CurrentItem);
if NbSousChaine(Chaine, CurrentItem) > 0 then
begin
Result := Index;
Exit;
end;
end;
end;
{----------------< FUNCTION Cherche_ListBox_Precedant >------------------}
function Cherche_ListBox_Precedant(Chaine : string ; ListBox : TListBox) : Integer;
var
Index : integer;
CurrentItem : string;
begin
Result := -1;
Chaine := UpperCase(Chaine);
for Index := listbox.ItemIndex-1 downto 0 do
begin
CurrentItem := UpperCase(ListBox.Items.Strings[Index]);
//AddError(IntToStr(Index) + ' WinText : ' + Chaine + ' Nb Sous Chaine : ' + IntToStr(NbSousChaine(Chaine, CurrentItem)));
//AddError(Chaine + ' - ' + CurrentItem);
if NbSousChaine(Chaine, CurrentItem) > 0 then
begin
Result := Index;
Exit;
end;
end;
end;
bonne prog, A+
7 mai 2009 à 17:42
Ca merite la note maxi...
8 janv. 2008 à 16:11
super cela m'a economisé quelques nuits de sommeil !!
juste deux fonctions supplèmentaires pour completer ton travail :
{-----------------< FUNCTION Cherche_ListBox_Suivant >-------------------}
function Cherche_ListBox_Suivant(Chaine : string ; ListBox : TListBox) : Integer;
var
Index : integer;
CurrentItem : string;
begin
Result := -1;
Chaine := UpperCase(Chaine);
for Index := listbox.ItemIndex+1 to ListBox.Items.Count - 1 do
begin
CurrentItem := UpperCase(ListBox.Items.Strings[Index]);
//AddError(IntToStr(Index) + ' WinText : ' + Chaine + ' Nb Sous Chaine : ' + IntToStr(NbSousChaine(Chaine, CurrentItem)));
//AddError(Chaine + ' - ' + CurrentItem);
if NbSousChaine(Chaine, CurrentItem) > 0 then
begin
Result := Index;
Exit;
end;
end;
end;
{----------------< FUNCTION Cherche_ListBox_Precedant >------------------}
function Cherche_ListBox_Precedant(Chaine : string ; ListBox : TListBox) : Integer;
var
Index : integer;
CurrentItem : string;
begin
Result := -1;
Chaine := UpperCase(Chaine);
for Index := listbox.ItemIndex-1 downto 0 do
begin
CurrentItem := UpperCase(ListBox.Items.Strings[Index]);
//AddError(IntToStr(Index) + ' WinText : ' + Chaine + ' Nb Sous Chaine : ' + IntToStr(NbSousChaine(Chaine, CurrentItem)));
//AddError(Chaine + ' - ' + CurrentItem);
if NbSousChaine(Chaine, CurrentItem) > 0 then
begin
Result := Index;
Exit;
end;
end;
end;
bonne prog, A+