PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → HFilter, how does it work ?
HFilter, how does it work ?
Started by soubyms, Jun., 23 2001 12:31 AM - 3 replies
Posted on June, 23 2001 - 12:31 AM
Can some one give mi a hint on how to make HFilter's second option Hfilter
with a condition.

nMes is int
nAno is int

nMes = 2
nAno = 2001

HFilter( "RECETAS" , "RECETAS.REMES = '" + nMes + "' and RECETAS.REANO = '"
+ nAno + "'" )

HReadFirst( "RECETAS" , "CLAVE" )

This works erratically, and it's driving me nuts.

I DON'T have an index on REMES nor on REANIO.

Thx
Posted on June, 23 2001 - 11:29 PM
Hi MAriano

Try

HFilter( "RECETAS" , "CLAVE" ,"RECETAS.REMES = '" + nMes + "' and
RECETAS.REANO = '"
+ nAno + "'" )

HReadFirst( "RECETAS" , "CLAVE" )

HFilter only works on a key value, and you can't change that value
beteen the filter and the browse.

I use a filtered browse for better results. See the manual under Browse.

Gill

Mariano Saul wrote:

Can some one give mi a hint on how to make HFilter's second option Hfilter
with a condition.

nMes is int
nAno is int

nMes = 2
nAno = 2001

HFilter( "RECETAS" , "RECETAS.REMES = '" + nMes + "' and RECETAS.REANO = '"
+ nAno + "'" )

HReadFirst( "RECETAS" , "CLAVE" )

This works erratically, and it's driving me nuts.

I DON'T have an index on REMES nor on REANIO.

Thx
Posted on June, 25 2001 - 11:51 AM
This is right, but your syntax is not correct, you don't have to put the
name of your data file ( RECETAS.REMES )
HFilter( "RECETAS" , "CLAVE" ,"REMES = '" + nMes + "' and REANO = '"+ nAno +
"'" )
And remember the single quote is used for the TEXT not for NUMBERS !!!!
So your line code must be :

HFilter( "RECETAS" , "CLAVE" ,"REMES = " + nMes + " and REANO = "+ nAno )

I also recommend you to use the tostring function ( you will control the
format of your numbers in the filter string ).


"Gill Davis" <gill@postrans.com> a écrit dans le message news:
3B347DB1.F6296D52@postrans.com...
Hi MAriano

Try

HFilter( "RECETAS" , "CLAVE" ,"RECETAS.REMES = '" + nMes + "' and
RECETAS.REANO = '"
+ nAno + "'" )

HReadFirst( "RECETAS" , "CLAVE" )

HFilter only works on a key value, and you can't change that value
beteen the filter and the browse.

I use a filtered browse for better results. See the manual under Browse.

Gill

Mariano Saul wrote:

Can some one give mi a hint on how to make HFilter's second option

Hfilter
with a condition.

nMes is int
nAno is int

nMes = 2
nAno = 2001

HFilter( "RECETAS" , "RECETAS.REMES = '" + nMes + "' and RECETAS.REANO =

'"
+ nAno + "'" )

HReadFirst( "RECETAS" , "CLAVE" )

This works erratically, and it's driving me nuts.

I DON'T have an index on REMES nor on REANIO.

Thx
Posted on June, 27 2001 - 8:13 PM
Hi

This syntax does not seem fully correct however. There are two different
syntax you can use with your HFilter :
1.
Hfilter(FILE,KEY,MINVALUE,CONDITION)

2.
KEY=Hfilter(FILE,CONDITION)

The second one gives you the key you have to use after the filter is
set. In the first one you cannot avoid giving the minvalue of the key.

Hope this will help.


BOUDOT Sébastien wrote:

This is right, but your syntax is not correct, you don't have to put the
name of your data file ( RECETAS.REMES )
HFilter( "RECETAS" , "CLAVE" ,"REMES = '" + nMes + "' and REANO = '"+ nAno +
"'" )
And remember the single quote is used for the TEXT not for NUMBERS !!!!
So your line code must be :

HFilter( "RECETAS" , "CLAVE" ,"REMES = " + nMes + " and REANO = "+ nAno )

I also recommend you to use the tostring function ( you will control the
format of your numbers in the filter string ).


"Gill Davis" <gill@postrans.com> a écrit dans le message news:
3B347DB1.F6296D52@postrans.com...

Hi MAriano

Try

HFilter( "RECETAS" , "CLAVE" ,"RECETAS.REMES = '" + nMes + "' and
RECETAS.REANO = '"
+ nAno + "'" )

HReadFirst( "RECETAS" , "CLAVE" )

HFilter only works on a key value, and you can't change that value
beteen the filter and the browse.

I use a filtered browse for better results. See the manual under Browse.

Gill

Mariano Saul wrote:

Can some one give mi a hint on how to make HFilter's second option

Hfilter


with a condition.

nMes is int
nAno is int

nMes = 2
nAno = 2001

HFilter( "RECETAS" , "RECETAS.REMES = '" + nMes + "' and RECETAS.REANO =

'"


+ nAno + "'" )

HReadFirst( "RECETAS" , "CLAVE" )

This works erratically, and it's driving me nuts.

I DON'T have an index on REMES nor on REANIO.

Thx