Page 1 of 1
busqueda en una dbf / dbf search
Posted: Fri Oct 18, 2013 4:22 pm
by CarlosRD
HOLA A TODOS / HI ALL:
TENGO LA NECESIDAD DE HACER LA SIGUIENTE BUSQUEDA Y NO LA HE ENCONTRADO EN LOS EJEMPLOS DE LA VERSION 3.0.46
SI EN UNA BASE DE DATOS TENGO LOS SIGUIENTES REGISTROS:
REGISTRO 1 -> JUAN PEREZ BOTIJA
REGISTRO 2 -> JUAN ESPINOZA REYES
REGISTRO 3 -> ESPERANZA LOPEZ PEREZ
REGISTRO 4 -> PEREZ REYES JOSE LUIS
REGISTRO 5 -> CARLOS ZARATE LOZADA
SI POR MEDIO DE UN TEXTBOX INGRESO LA PALABRA “PEREZ”, NECESITO OBTENER LO SIGUIENTE:
REGISTRO 1 -> JUAN PEREZ BOTIJA
REGISTRO 3 -> ESPERANZA LOPEZ PEREZ
REGISTRO 4 -> PEREZ REYES JOSE LUIS
ALGUIEN HA HECHO ESTO ANTES???
SALUDOS, CARLOS RD.
************************************
I HAVE THE NEED FOR THE NEXT SEARCH AND HAVE NOT FOUND IN THE EXAMPLES OF VERSION 3.0.46
IF I HAVE NEXT RECODS IN A DATABASE:
RECORD 1 -> JUAN PEREZ BOTIJA
RECORD 2 -> JUAN ESPINOZA REYES
RECORD 3 -> ESPERANZA LOPEZ PEREZ
RECORD 4 -> PEREZ REYES JOSE LUIS
RECORD 5 -> CARLOS ZARATE LOZADA
USING A TEXTBOX CONTROL I TYPE “PEREZ”, I NEED TO GET NEXT:
REGISTRO 1 -> JUAN PEREZ BOTIJA
REGISTRO 3 -> ESPERANZA LOPEZ PEREZ
REGISTRO 4 -> PEREZ REYES JOSE LUIS
ANYBODY HERE HAS MADE SOMETHING LIKE THIS???
REGARDS, CARLOS RD.
Re: busqueda en una dbf / dbf search
Posted: Fri Oct 18, 2013 4:50 pm
by esgici
Did you tried
OrdWildSeek()
By the way, why you are writing everything in uppercase
Vikipedia wrote:With the advent of the Bulletin board system, or BBS, and later the Internet, typing messages in all caps became closely identified with "shouting" (yelling) or attention-seeking behavior, and is considered very rude. As a result, netiquette generally discourages the use of all caps when posting messages online. While all caps can be used as an alternative to rich-text "bolding" for a single word or phrase, to express emphasis, repeated use of all caps can be considered "shouting" or irritating.
Source is
here
Happy HMG'ing

Re: busqueda en una dbf / dbf search
Posted: Fri Oct 18, 2013 5:52 pm
by CarlosRD
Thanks Esgici.
Ordwildseek() works perfect.
About my writing with uppercase, it was only because my keyboard had activated the capslook key.
regars, Carlos RD
Re: busqueda en una dbf / dbf search
Posted: Fri Oct 18, 2013 6:17 pm
by Mario Mansilla
Hola Carlos :
podrias publicar un ejemplo de como lo utilizaste ?
Saludos
Mario Mansilla
Hi Carlos:
could you post an example of how you used it?
regards
Mario Mansilla
Re: busqueda en una dbf / dbf search
Posted: Fri Oct 18, 2013 7:12 pm
by esgici
CarlosRD wrote:
Ordwildseek() works perfect.
I'm glad that you like it
About my writing with uppercase, it was only because my keyboard had activated the capslook key.
No problem amigo; I was sure that you understood me
Happy HMG'ing

Re: busqueda en una dbf / dbf search
Posted: Fri Oct 18, 2013 7:16 pm
by esgici
Mario Mansilla wrote:
could you post an example of how you used it?
Hola Mario
You would find
here an explanation and a simple examle; if you need more detailed exmple, please inform me.
Happy HMG'ing

Re: busqueda en una dbf / dbf search
Posted: Fri Oct 18, 2013 7:24 pm
by CarlosRD
Mario Mansilla wrote:
Hola Carlos :
podrias publicar un ejemplo de como lo utilizaste ?
Saludos
Mario Mansilla
con mucho gusto mario, buenas tardes.
Code: Select all
function busca_cliente(f_dato) // funcion llamada por una tecla o procedimiento para filtrar información
m_recnos_found := {} // array para anidar los registros que coincidan
select wa_clientes // archivo de clientes (work area), en donde voy a realizar la busqueda
go top
do while OrdWildSeek( f_dato , .t. )
aadd ( m_recnos_found, { wa_clientes->clave, wa_clientes->nombre } ) // agrego al arrar, los registros coincidentes
enddo
return (m_recnos_found)
Asi quedaria el procedimiento de la busqueda, luego el array que regresa a tu llamada, lo puedes anidar en un listbox para seleccionar al cliente (en este caso) que necesitas.
Espero que mi explicacion sea la correcta. Saludos, Carlos RD.
Re: busqueda en una dbf / dbf search
Posted: Fri Oct 18, 2013 8:09 pm
by Mario Mansilla
Hola Carlos / Esgici :
muchas gracias por su ayuda .
Personalmente utilizo mucho el onchange de un textbox para ingresar el criterio de busqueda y el resultado lo muestro en un control browse evaluando con Dbseek . Ambos ejemplo que me muestran utilizan un control grid o listbox , veo si lo puedo implementar con un control browse .
Cualquier cosa les consulto .
Saludos .
Mario Mansilla
Re: busqueda en una dbf / dbf search
Posted: Fri Oct 18, 2013 8:28 pm
by esgici
Hola Carlos and Mario
This example may considered more clear and more useful :
Code: Select all
// The example uses two wildcard search strings to show
// possible search results of OrdWildSeek()
PROCEDURE Main
LOCAL aCust := {}
USE Customer
INDEX ON Upper(LastName) TO Cust01
DO WHILE OrdWildSeek( "*MAN?", .T. )
AAdd( aCust, FIELD->Lastname )
ENDDO
AEval( aCust, {|c| QOut(c) } )
// Found records:
// Dormann
// Feldman
GO TOP
aCust := {}
DO WHILE OrdWildSeek( "*EL*", .T. )
AAdd( aCust, FIELD->Lastname )
ENDDO
AEval( aCust, {|c| QOut(c) } )
// Found records:
// Feldman
// Hellstrom
// Keller
// Reichel
USE
RETURN
Happy HMG'ing
