Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UDF and FP Function, partiality
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00677396
Message ID:
00678972
Vues:
22
Thank you the function worked with a tweak
> m.typgrpFlt = m.typgrpFlt + ' OR "' + ;
> EVALUATE("m.val" + ALLTRIM(STR(m.cntr-1))) + '" $ ' + m.typegroup

Now I have run up against 255 line length limit when I club the new filter with the required basic filters <g>

>Foxpro 2.x doesn't allow UDF's in the SET FILTER condition. You'll have to build filter condition that uses Foxpro functions.
* FUNCTION FltTypGrp - builds filter condition
>PARAMETERS m.typegroup, m.val1, m.val2, ..., m.val10
>PRIVATE m.cntr, m.typgrpFlt
>m.typgrpFlt = ""
>FOR m.cntr=2 TO PCOUNT()
>  m.typgrpFlt = m.typgrpFlt + [ OR "] + ;
>  	EVALUATE("m.val" + TRANSFORM(m.cntr-1)) + [" $ ] + m.typegroup
>ENDFOR
>RETURN SUBSTR(m.typgrpFlt	, 5)
>...
>m.typefilt = flttypgrp("a09macct.typegroup", "CASH", "BANK")
>...
>
>
>>That is where the partiality comes in.
>>
>>
>>>>m.typefilt = "INLIST(a09macct.typegroup, 'CASH', 'BANK')"
>>and my old way of parameter passing works
>>
>>Change typefilt to:
>>
>>>>m.typefilt = "typgrp(a09macct.typegroup, 'CASH', 'BANK')"
>>and FPD25 generates an error on the SET FILTER TO &zfilter. line in my INVHLP function:
>>
>>Error: 31
>>Message: Invalid Subscript Reference
>>
>>Even for the following simple function:
>>
>>
Function typgrp
>>parameters m.z1, m.z2, m.z3
>>return inlist(m.z1, m.z2, m.z3)
>>
>>the para m.zfilter with the value "typgrp(a09macct.typegroup, 'CASH', 'BANK')" is now, I guess, interpreted as an array, where as when the m.zfilter was "INLIST(a09macct.typegroup, 'CASH', 'BANK')" FP knew it was a function. So if I send &typefilt. then the current value is interpreted and sent to invhelp() and invhelp won't like it at the IF line before SET FILTER. Plus the value passed is for the current record only and the utiliy won't remain.
>>
>>How can I tell FP typgrp is a function and not an array. I can't do this in the invhelp() function as it is a common usage thing and I don't know if there will be any filters required or not and if so am I using UDF or FP functions.
>>
>>
>< snip >
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform