eCGec68
-
Modifié par NHenry le 22/08/2015 à 23:29
Cirec
Messages postés3833Date d'inscriptionvendredi 23 juillet 2004StatutModérateurDernière intervention18 septembre 2022
-
23 août 2015 à 17:41
Bonjour,
J ai beau chercher comment résoudre mon problème.
Je m'explique j'ai dans unn fichier html une balise comme ceci <span id="navcaption">Sélectionner une catégorie</span>
et dans mon programme j'aimerais la supprimer
avec cette procedure je n'y arrive pas :
function SearchBal( const S, Src: string): Integer;
var
LnS : Integer;
LnSrc : Integer;
I, J : Integer;
PS : PChar;
PSrc : PChar;
FindStr : Boolean;
begin
Result := -1;
LnS := Length(S);
LnSrc := Length(Src);
PS := PChar(S);
PSrc := PChar(Src);
I := 0;
while I < LnSrc do
begin
if PSrc^ = PS^ then
begin
FindStr := True;
J := 0;
while J < LnS do
begin
if PSrc^ <> PS^ then
begin
FindStr := False;
Break;
end;
Inc(PSrc);
Inc(PS);
Inc(I);
Inc(J);
end;
PS := @S[1];
if FindStr then
begin
Result := I;
Break;
end;
end
else
begin
Inc(PSrc);
Inc(I);
end;
end;
end;
Merci pour votre aide
EDIT : Ajout des balises de code (la coloration syntaxique). Explications disponibles ici : ICI