Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Como hacer un buscador de numeros telefonicos (https://www.clubdelphi.com/foros/showthread.php?t=86427)

wile777 20-08-2014 23:36:58

ME FUNCIONA CON ESTE CODIGO PERO SOLO ME ABRE TODA LA BASE DE DATOS:

[procedure TForm1.Button2Click(Sender: TObject);
begin
ProgressBar1.Position := ProgressBar1.Min;
ProgressBar1.Position := ProgressBar1.Max;
If Edit1.Text = '' then // aqui envio un mensaje si esta vacio el Edit1
begin
MessageBox(Handle,
PChar('Tiene que Indicar el numero TELEFONICO o Dato a Colsultar'),
PChar(''),
MB_OK + MB_ICONWARNING + MB_DEFBUTTON1 + MB_APPLMODAL);
end
else // de lo contrario hago lo que sigue
begin
// conectar y obtener datos
ADOTable1.Open
end;]


LE PONGO ESTE QUE ME DIO ecfisa PARA LOGRAR LO QUE QUIERO QUE ME BUSQUE LA RELACION DE LO QUE PONGA EN EL TEDIT1:

[procedure TForm1.btnSearchOneClick(Sender: TObject);
begin
SearchData('TELEFONO', Edit1.Text);
end;

procedure TForm1.ButtonFilterClick(Sender: TObject);
begin
FilterData('DIRECCION', Edit1.Text)
end;

(* Elimina cualquier filtro prefijado *)
procedure TForm1.btnFilterOffClick(Sender: TObject);
begin
ADOTable1.Filtered:= False
end;]


ME DA ESTOS ERRORES:

[Error] Unit1.pas(97): Undeclared identifier: 'btnSearchOneClick'
[Error] Unit1.pas(97): ';' expected but '(' found
[Error] Unit1.pas(99): Undeclared identifier: 'SearchData'
[Error] Unit1.pas(99): Undeclared identifier: 'Edit1'
[Error] Unit1.pas(100): Statement expected, but expression of type 'Text' found
[Error] Unit1.pas(102): Undeclared identifier: 'ButtonFilterClick'
[Error] Unit1.pas(102): ';' expected but '(' found
[Error] Unit1.pas(104): Undeclared identifier: 'FilterData'
[Error] Unit1.pas(104): Undeclared identifier: 'Edit1'
[Error] Unit1.pas(105): Statement expected, but expression of type 'Text' found
[Error] Unit1.pas(108): Undeclared identifier: 'btnFilterOffClick'
[Error] Unit1.pas(108): ';' expected but '(' found
[Error] Unit1.pas(110): Undeclared identifier: 'ADOTable1'
[Error] Unit1.pas(113): '.' expected but ';' found
[Error] Unit1.pas(35): Unsatisfied forward or external declaration: 'TForm1.Button2Click'
[Fatal Error] Project1.dpr(6): Could not compile used unit 'Unit1.pas'

Casimiro Noteví 20-08-2014 23:51:55

Creo que falta un punto y coma en un par de líneas;
Código Delphi [-]
procedure TForm1.ButtonFilterClick(Sender: TObject);
begin
   FilterData('DIRECCION', Edit1.Text);  //   <--------------
end;

(* Elimina cualquier filtro prefijado *)
procedure TForm1.btnFilterOffClick(Sender: TObject);
begin
  ADOTable1.Filtered:= False;  //   <--------------
end;



Por cierto, recuerda poner los tags al código fuente, ejemplo:



Gracias :)

ecfisa 26-08-2014 02:28:44

Hola wile777.
Cita:

Empezado por wile777 (Mensaje 480203)
ME DA ESTOS ERRORES:

[Error] Unit1.pas(97): Undeclared identifier: 'btnSearchOneClick'
[Error] Unit1.pas(97): ';' expected but '(' found
[Error] Unit1.pas(99): Undeclared identifier: 'SearchData'
[Error] Unit1.pas(99): Undeclared identifier: 'Edit1'
[Error] Unit1.pas(100): Statement expected, but expression of type 'Text' found
[Error] Unit1.pas(102): Undeclared identifier: 'ButtonFilterClick'
[Error] Unit1.pas(102): ';' expected but '(' found
[Error] Unit1.pas(104): Undeclared identifier: 'FilterData'
[Error] Unit1.pas(104): Undeclared identifier: 'Edit1'
[Error] Unit1.pas(105): Statement expected, but expression of type 'Text' found
[Error] Unit1.pas(108): Undeclared identifier: 'btnFilterOffClick'
[Error] Unit1.pas(108): ';' expected but '(' found
[Error] Unit1.pas(110): Undeclared identifier: 'ADOTable1'
[Error] Unit1.pas(113): '.' expected but ';' found
[Error] Unit1.pas(35): Unsatisfied forward or external declaration: 'TForm1.Button2Click'
[Fatal Error] Project1.dpr(6): Could not compile used unit 'Unit1.pas'

Por órden de aparición, controla que:
  1. En tu form exista un componente TButton y se llame "btnSearchOneClick".
  2. ¿ Copiaste y pegaste la función "SearchData" ?.
  3. En tu form exista un componente TEdit y se llame "Edit1".
  4. En tu form exista un componente TButton y se llame "ButtonFilterClick".
  5. ¿ Copiaste y pegaste la función "FilterData" ?.
  6. En tu form exista un componente TButton y se llame "btnFilterOffClick".
  7. En tu form exista un componente TADOTable y se llame "ADOTable1".
  8. Que el componente "Button2" tenga asociado el método "Button2Click".
  9. Que tu form se llame "Form1".

Saludos :)


La franja horaria es GMT +2. Ahora son las 01:26:39.

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