Class to manager MYSQL for Harbour/xHarbour
Custom Search

sábado, 31 de julio de 2010

Actuazalicion / Update

> tdolpqry.PRG
> function.c
Nuevas funnciones y metodos para localizar registros en una consulta
New functions and Method to locate record
METHOD Find( aValues, aFields, nStart, nEnd, lRefresh )
aValues = Array de datas a buscar / data array to seek
aField = Array de campos que filtrara la busqueda / Field array to filter seek
nStart = Registro  comienzo para buscar / start record to seek
nEnd = Registro final a bsucar / end record to seek
Este metodo no tiene ninguna restriccion, buscara de forma secuencial dentro de la consulta activa, devolvera el primer registro que satisfaga la condicion de busqueda
this method dont have any restriction,  will seek sequentally inside active query, return the first record that, will return the first record that satisfies the search condition

METHOD Locate( aValues, aFields, nStart, nEnd, lRefresh )
igual al metodo Find, la diferencia es, este metodo es mas rapido y para obtener los resultados deseados, debera estar la consulta ordenada de igual forma a los campos a buscar
ejemplo.
si desea buscar por field1, field2 y field3 la consulta debera estar ordenada ORDER BY field1, field2, field3

same Method Find, the difference is: this method is more fast, to get better result, the query should be order same  to field seek
ie.
if you want seek  field1, field2 and field3 the query should be order like ORDER BY field1, field2, field3


sample:

oQry = oServer:Query( "SELECT * FROM clientes ORDER BY first, last " )

oQry:Find( { "Vincent", "Brook" }, {"first", "last" } )
oQry:Locate( { "Vincent", "Brook" }, {"first", "last" } )




viernes, 30 de julio de 2010

Rapido!!!! / Fast!!!!

He realizado una nueva funcion SEEK para busquedas que IMPRESINANTEMENTE RAPIDA
I did a new function SEEK to seek, is INCREDIBLE  FAST

el ejemplo consta de 50.000 resgistros y el resultado buscando la "Z" con la rutina actual fue:
the sample is 50.000 record and result seeking "Z", with current seek method was:

Download Test (new method)



Nuevo metodo Seek
New Seek Method

Paginacion / Pagination

Dolphin maneja la paginacion automaticamente, explicare las datas y  metodo que usa
Dolphin manage automatically pagination, i will explain what datas and method used

DATAS

nCurrentPage     Pagina activa / Current page
nTotalRows        Total filas en la consulta / Total row without limits
nPageStep           Total filas por pagina / total rows for page
nMaxPages         Cantidad maxima de paginas en la consulta / Max pages avalaible in query
nCurrentLimit      Limite activop / Current limit value
bOnChangePage Code Block que se evealua cada vez que se cambia una pagina / codeblock to evaluate when change page


METHOD
SetPages( nLimit ) Activa la paginacion y configura la cantidad de lineas por paginas nLimit, Activate pagination and Set total rows by page nLimit
NextPage( nSkip ) Va a la siguiente pagina disponible o avanza nSkip paginas / Go to next page avalaible or skip nSkip pages
PrevPage( nSkip ) Va a la  pagina anterior disponible o retrocede nSkip paginas / Go to previous page avalaible or back nSkip pages
FirstPage() Va a la primera pagina / Go to first page
LastPage() Va a la ultima pagina / Go to last page
GotoPage( nPage )   Va a la pagina espcifica por nPage / Go to specific nPage Page


El ejemplo esta construido con la version 10.7 de fivewin / This samples was built with fivewin version 10.7 
Ejemplo / Sample

Download Here

//Build
   oQry = oServer:Query( "SELECT * FROM clientes ORDER BY last limit 100" 

   oQry:SetPages( 100 )
   oQry:bOnChangePage = { || oBrw:Refresh(), ChangeTitle( oQry, oDlg ) }




//Button Actions


   @ 10, 10 RBBTN aBtns[ 1 ] PROMPT "&First" OF oDlg SIZE 20, 15 ;
            GROUPBUTTON FIRST  CENTER ;
            ROUND ROUNDSIZE 2;
            ACTION( oQry:FirstPage() ) ;
            WHEN( oQry:nCurrentPage > 1 )                  

   @ 10, 30 RBBTN  aBtns[ 2 ] PROMPT "&Prev" OF oDlg SIZE 20, 15 ;
            GROUPBUTTON  CENTER ;
            ROUND ROUNDSIZE 2;
            ACTION( oQry:PrevPage() ) ;
            WHEN( oQry:nCurrentPage > 1 )

   @ 10, 50 RBBTN aBtns[ 3 ] PROMPT "&Goto" OF oDlg SIZE 20, 15 ;
             GROUPBUTTON  CENTER ;
             ROUND ROUNDSIZE 2;
             ACTION( nPage := oQry:nCurrentPage,;
                     MsgGet( "Select Page:", "Page", @nPage ),;
                     oQry:GoToPage( nPage ) )


   @ 10, 70 RBBTN aBtns[ 4 ] PROMPT "&Next" OF oDlg SIZE 20, 15 ;
             GROUPBUTTON  CENTER ;
             ROUND ROUNDSIZE 2;
             ACTION( oQry:NextPage() ) ;
             WHEN( oQry:nCurrentPage < oQry:nMaxPages )

   @ 10, 90 RBBTN aBtns[ 5 ] PROMPT "&Last" OF oDlg SIZE 20, 15 ;
             GROUPBUTTON END  CENTER ;
             ROUND ROUNDSIZE 2;          
             ACTION( oQry:LastPage() ) ;
             WHEN( oQry:nCurrentPage < oQry:nMaxPages )



XBrowse

Una buena noticia... / Good News

Se ha incluido dentro del xbrowse de fivewin la configuracion para le uso de TDolphin

Was included inside fivewin xbrowse, the TDolphin configuration


http://forums.fivetechsupport.com/viewtopic.php?f=16&t=19450

miércoles, 28 de julio de 2010

Actuazalicion / Update

+ Nuevo: Funcion D_LogicalValue( lOnOff ), activa / Desactiva el uso de valores logicos, permitiendo hacer uso de las variables logicas de [x]Harbour como 1/0, sin argumento retorna el estatus actual sino retorna el estatus anterior,  por omision esta activado

+ New: function D_LogicalValue( lOnOff ), activate / Deactivate Logical values, for use [x]Harbour logical values like 1/0, without argument return current value else return Old Status, default status is Activated

Usar / To Use

D_LogicalValue( .F. ) //Deactivate

Gracias a Willi por la sugerencias / Thanks Willi by suggestion  

martes, 27 de julio de 2010

TDolphin in OSX

TDolphin ahora en Mac (osx), explicare como generar las libreria de MySql y las libreria de Dolphin
TDolphin now in Mac( osx), i will explain how build MySql Lib and Dolphin libs

Herramientas/ Tools
Descargar cMake / Download cMake

Mysql
Descargar fuentes de MySql / Download Mysql Source Code



Dolphin
Descargar dolphin desde el SVN / Download Dolphin from SVN
www.sitasoft.net/dolphinosx
Descargar Directa Dolphin  / Direct Download Dolphin
Esta incluida la libreria dolphin y Mysql, harbour / Include Dolphin and MySql Lib, harbour
estan construidas en Snow Leopard / built in Snow Leopard


Installing...

1- Instalar CMake / Install CMake
2- Descomprimir Codigo fuente de MySql / UnZip MySql Source Code
A la carpeta descomprimida (ej. mysql-connector-c-6.0.2), personalmente, le cambio el nombre para ser mas facil accesarla desde el terminal (ej. connector) / The unzip folder (ie. mysql-connector-c-6.0.2), personally, i change the folder name to easy access from terminal (ie. connector)
3- Abrir el Terminal e ir a la carpeta descomprimida de MySql / Open Terminal and go to MySql unzip folder
4- cmake -G "Unix Makefiles"
5- make
6- Descomprimir archivo de dolphin (Descarga Directa) / Unzip dolphin file (Direct Download)
7- desde el terminal ir a la carpeta descomprimida de Dolphin / from terminal go to dolphin unzip folder
8- make

para constuir los ejemplos con fivemac, deberan cambiar los path dentro de buildfw.sh (si fuese necesario) / Build fivemac samples, should change path inside buildfw.sh (if is necessary) 


viernes, 23 de julio de 2010

Debido al comentario de Charly hice un ajuste al ejemplo TestFile
For Charly comment, i did a little adjust to samples TestFile

"Charly dijo...
Daniel,
A medida que vas añadiendo ficheros, el sistema se vuelve mas lento al hacer el browse(). Seguramente en la lectura te bajas tambien el contenido del blob..."

"Charly said ...
Daniel,
As you add files, the system becomes slower to make the browse (). Probably you're reading the contents of the blob ... "


Gracias Charly por el feedback
Thank Charly by Feedback