Author | Topic: Using functions in filter expression generates random error | |
---|---|---|
Damir Hodak | Using functions in filter expression generates random error on Thu, 19 Dec 2013 10:53:03 +0100 Hi all! Recently I discovered a strange thing. In one of my reports I'm using function AScan to filter records which value of specified column is in specified list of values. For example: Ascan({ "A", "B", "C" }, FIELD1) != 0 After running report for a few times (usualy 3-4 times) without exiting the program random errors raises. In attachment you have samples of errors. All errors was generated after using program in same conditions. It took a long time for me to isolate reason for this errors. If I use a user function in filter expression instead AScan function errors are still generated. But, if I replace AScan function with expression (field1="A".or.field1="B".or.field1="C") errors are NOT generated. Does anybody had the same or similar situation? Do you have any other solution to this problem? I'm using Alaska Xbase++ 1.90.355 SL1 with HotFix RollUp 50 and FOXCDX DBE. Regards Damir XPPERROR1.LOG XPPERROR2.LOG XPPFATAL1.LOG XPPFATAL2.LOG | |
Boris Borzic | Re: Using functions in filter expression generates random error on Thu, 19 Dec 2013 18:06:13 +0100 Damir Hodak wrote in news:mm840oc03fq3$.2c4mjm6pff3p$.dlg@40tude.net: > Recently I discovered a strange thing. > In one of my reports I'm using function AScan to filter records which > value of specified column is in specified list of values. For example: > Ascan({ "A", "B", "C" }, FIELD1) != 0 > After running report for a few times (usualy 3-4 times) without > exiting the program random errors raises. In attachment you have > samples of errors. All errors was generated after using program in > same conditions. > > It took a long time for me to isolate reason for this errors. > If I use a user function in filter expression instead AScan function > errors are still generated. > But, if I replace AScan function with expression > (field1="A".or.field1="B".or.field1="C") errors are NOT generated. > > Does anybody had the same or similar situation? > Do you have any other solution to this problem? You can try using the $ operator insead of AScan (much faster), eg: option 1: (FIELD1 $ {'A','B','C'}) option 2: ('/'+FIELD1+'/' $ '/A/B/C/') You can replace the '/' char with any other char that is unlikely to occur in FIELD1. Best regards, Boris Borzic http://xb2.net http://sqlexpress.net industrial strength Xbase++ development tools | |
Damir Hodak | Re: Using functions in filter expression generates random error on Fri, 20 Dec 2013 10:22:18 +0100 On Thu, 19 Dec 2013 18:06:13 +0100, Boris Borzic wrote: > Damir Hodak wrote in news:mm840oc03fq3$.2c4mjm6pff3p$.dlg@40tude.net: > >> Recently I discovered a strange thing. >> In one of my reports I'm using function AScan to filter records which >> value of specified column is in specified list of values. For example: >> Ascan({ "A", "B", "C" }, FIELD1) != 0 >> After running report for a few times (usualy 3-4 times) without >> exiting the program random errors raises. In attachment you have >> samples of errors. All errors was generated after using program in >> same conditions. >> >> It took a long time for me to isolate reason for this errors. >> If I use a user function in filter expression instead AScan function >> errors are still generated. >> But, if I replace AScan function with expression >> (field1="A".or.field1="B".or.field1="C") errors are NOT generated. >> >> Does anybody had the same or similar situation? >> Do you have any other solution to this problem? > > You can try using the $ operator insead of AScan (much faster), eg: > > option 1: > (FIELD1 $ {'A','B','C'}) > > option 2: > ('/'+FIELD1+'/' $ '/A/B/C/') > > You can replace the '/' char with any other char that is unlikely to > occur in FIELD1. Hi Boris In the beginning I used $ operator, but Xbase++ don't work good with $ operator in filters (in some situations it gives me wrong records - records which does not meet filter condition or none record). Regards Damir | |
James Loughner | Re: Using functions in filter expression generates random error on Fri, 20 Dec 2013 21:53:51 -0500 What version are you using? As far as I know the $ in filters works in the current version. It was broken n earlier version. Jim On 12/20/2013 04:22 AM, Damir Hodak wrote: > On Thu, 19 Dec 2013 18:06:13 +0100, Boris Borzic wrote: > >> Damir Hodak wrote in news:mm840oc03fq3$.2c4mjm6pff3p$.dlg@40tude.net: >> >>> Recently I discovered a strange thing. >>> In one of my reports I'm using function AScan to filter records which >>> value of specified column is in specified list of values. For example: >>> Ascan({ "A", "B", "C" }, FIELD1) != 0 >>> After running report for a few times (usualy 3-4 times) without >>> exiting the program random errors raises. In attachment you have >>> samples of errors. All errors was generated after using program in >>> same conditions. >>> >>> It took a long time for me to isolate reason for this errors. >>> If I use a user function in filter expression instead AScan function >>> errors are still generated. >>> But, if I replace AScan function with expression >>> (field1="A".or.field1="B".or.field1="C") errors are NOT generated. >>> >>> Does anybody had the same or similar situation? >>> Do you have any other solution to this problem? >> >> You can try using the $ operator insead of AScan (much faster), eg: >> >> option 1: >> (FIELD1 $ {'A','B','C'}) >> >> option 2: >> ('/'+FIELD1+'/' $ '/A/B/C/') >> >> You can replace the '/' char with any other char that is unlikely to >> occur in FIELD1. > > Hi Boris > > In the beginning I used $ operator, but Xbase++ don't work good with $ > operator in filters (in some situations it gives me wrong records - records > which does not meet filter condition or none record). > > Regards > > Damir > | |
Damir Hodak | Re: Using functions in filter expression generates random error on Sat, 21 Dec 2013 11:42:45 +0100 On Fri, 20 Dec 2013 21:53:51 -0500, James Loughner wrote: > What version are you using? As far as I know the $ in filters works in > the current version. It was broken n earlier version. > > Jim > > > > On 12/20/2013 04:22 AM, Damir Hodak wrote: >> On Thu, 19 Dec 2013 18:06:13 +0100, Boris Borzic wrote: >> >>> Damir Hodak wrote in news:mm840oc03fq3$.2c4mjm6pff3p$.dlg@40tude.net: >>> >>>> Recently I discovered a strange thing. >>>> In one of my reports I'm using function AScan to filter records which >>>> value of specified column is in specified list of values. For example: >>>> Ascan({ "A", "B", "C" }, FIELD1) != 0 >>>> After running report for a few times (usualy 3-4 times) without >>>> exiting the program random errors raises. In attachment you have >>>> samples of errors. All errors was generated after using program in >>>> same conditions. >>>> >>>> It took a long time for me to isolate reason for this errors. >>>> If I use a user function in filter expression instead AScan function >>>> errors are still generated. >>>> But, if I replace AScan function with expression >>>> (field1="A".or.field1="B".or.field1="C") errors are NOT generated. >>>> >>>> Does anybody had the same or similar situation? >>>> Do you have any other solution to this problem? >>> >>> You can try using the $ operator insead of AScan (much faster), eg: >>> >>> option 1: >>> (FIELD1 $ {'A','B','C'}) >>> >>> option 2: >>> ('/'+FIELD1+'/' $ '/A/B/C/') >>> >>> You can replace the '/' char with any other char that is unlikely to >>> occur in FIELD1. >> >> Hi Boris >> >> In the beginning I used $ operator, but Xbase++ don't work good with $ >> operator in filters (in some situations it gives me wrong records - records >> which does not meet filter condition or none record). >> >> Regards >> >> Damir >> Hi Jim I'm using Alaska Xbase++ 1.90.355 SL1 with HotFix RollUp 50 and FOXCDX DBE. There is still open PDR 5227 which, I think, relates to my problem with $ operater and filters. Regards Damir |