Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros temas > Trucos
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Los mejores trucos

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 29-07-2007
Avatar de xEsk
[xEsk] xEsk is offline
Miembro Premium
 
Registrado: feb 2006
Posts: 454
Poder: 19
xEsk Va por buen camino
Hola, yo las dos segundas funciones que has puesto, las hubiera hecho un poco más "sencillas":

Código Delphi [-]
uses SysUtils, Classes;

function FindInStr(Text, Destination: String; CaseSensitive: Boolean): Boolean;
begin
  if CaseSensitive then Destination:=LowerCase(Destination);
  Result:=Pos(Text, Destination) > 0;
end;

function FindInTextFile(Text, Filepath: String; CaseSensitive: Boolean): Boolean;
var
  AFile: TStringList;

begin
  if FileExists(Filepath) then
    begin
      AFile:=TStringList.Create;
      try
        AFile.LoadFromFile(FilePath);
        Result:=FindInStr(Text, AFile.Text, CaseSensitive);
      finally
        AFile.Free;
      end;
    end;
end;

Lo que ya no sé, es si tus funciones serán mas rápidas o no. Hay que probarlo.

Saludos!
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 00:12:14.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi