Bye Google:
Hola Claudio,
Puerto es el mismo que Clipper para los tipos de datos utilizados para la indexación es el mismo. Lo que significa que puede referirse a la Guía de programación Clipper como si se trata de una Guía de Programación del puerto. La ampliación del puerto es el lado positivo de Clipper.
Asegúrese de que la fecha es de tipo carácter y su código es de tipo carácter en función de su enfoque de programación.
Aquí hay un código de ejemplo muy elemental:
** Supuestos: la base de datos requiere que debería ser el índice de código + DTOS (fecha de nacimiento)
** El controlador de base de datos es DBFCDX, el nombre del índice es igual que el nombre de tabla y la etiqueta de
** Utilizado es el Código.
Code: Select all
function Test()
LOCAL cDOB := CTOD("") // date of Birth
LOCAL cCode := "" // Code
PRIVATE cFilterKey := ""
PRIVATE dbYourTable := "YOURTABLE"
cCode := YOURTABLE->CODE
cDOB := DTOS( YOURTABLE->DOB )
cFilterKey := cCode + cDOB
use ( dbYourTable ) ALIAS YOURTABLE via RDDSETDEFAULT()
ordlistadd((dbYourTable))
ordsetfocus( "code", ( dbYourtable) )
ordscope( 0, "&cFilterKey" ) // set top scope
ordscope( 1, "&cFilterKey" ) // set bottom scope
dbgotop() // move the record pointer for the filter to take effect
.
.
. do whatever you want here
.
**-clear the scope
ordscope(0, nil)
ordscope(1, nil)
return
Espero que esto ayude ...
Recuerdos,
Danny
English:
Hi Claudio,
Harbour is the same as Clipper so the data types used for indexing is the same. Which means you can refer to Clipper programming guide if as it is a Harbour Programming Guide. The extension of Harbour is the plus side for Clipper.
Make sure that the date is of character type and your code is of character type depending on your programming approach.
Here is a very elementary example code:
**Assumptions: the database requires that it should be index by code + dtos(date of birth)
** the database driver is DBFCDX, the index name is same as the table name and the tag
** used is Code.
Code: Select all
function Test()
LOCAL cDOB := CTOD("") // date of Birth
LOCAL cCode := "" // Code
PRIVATE cFilterKey := ""
PRIVATE dbYourTable := "YOURTABLE"
cCode := YOURTABLE->CODE
cDOB := DTOS( YOURTABLE->DOB )
cFilterKey := cCode + cDOB
use ( dbYourTable ) ALIAS YOURTABLE via RDDSETDEFAULT()
ordlistadd((dbYourTable))
ordsetfocus( "code", ( dbYourtable) )
ordscope( 0, "&cFilterKey" ) // set top scope
ordscope( 1, "&cFilterKey" ) // set bottom scope
dbgotop() // move the record pointer for the filter to take effect
.
.
. do whatever you want here
.
**-clear the scope
ordscope(0, nil)
ordscope(1, nil)
return
I hope that helps...
Regards,
Danny