Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Repost - Search Expression needs UDF
Message
From
24/05/2001 13:50:48
 
General information
Forum:
Visual FoxPro
Category:
Stonefield
Miscellaneous
Thread ID:
00510340
Message ID:
00511083
Views:
21
I'm not exactly sure what you mean. After the .Show() the aQuery array is full as is the .cFilter. I can see what is in the .aQuery array but even if I try to replace its contents like so:

* if field is Custno, Empno or Vendno special formatting applies
FOR lnT=1 TO ALEN(toform.oQuery.aQuery,1)
IF 'CUSTNO' $ UPPER(toform.oQuery.aQuery[lnT,3] ) ;
OR 'VENDNO' $ UPPER(toform.oQuery.aQuery[lnT,3] ) ;
OR 'EMPNO' $ UPPER(toform.oQuery.aQuery[lnT,3] )
toform.oQuery.aQuery[lnT,5]="'"+toform.oQuery.aQuery[lnT,3]+"="+padl(eval (toform.oQuery.aQuery[lnT,10]),10)+"'"
toform.oQuery.aQuery[lnT,6]="{field}={padl}{val}{value}"
toform.oQuery.aQuery[lnT,7]="'"+toform.oQuery.aQuery[lnT,3]+"="+padl(eval(toform.oQuery.aQuery[lnT,10]),10)+"'"
ENDIF
ENDFOR

The .cFilter is still wrong and that is what I am using because I need to adjust if depending on the calling screen:

toForm.cSearchFilterExpr = .cFilter
if !empty(.cSearchFilterExpr)
if !empty(.cFilterExpr)
lcFilterExpr = .cFilterExpr + " AND " + .cSearchFilterExpr
else
lcFilterExpr = .cSearchFilterExpr
endif
set filter to &lcFilterExpr
endif

All my code is in a hook becuase I am replacing the Search method built within my framework Visual Extend.

Sandi.






>Hi Sandi,
>
>I think your best bet here is to let the user enter the value and they have finished with the query. So basically right after your call to the Show(). Call another method that can go and fix that fields expression.
>
>with Thisform
> lcFilter = .oQuery.cFilter
> .oQuery.Show()
>
>** Your call to a custom method.
> .CheckCustomerValue()
> set filter to &lcFilter
> .Refresh()
>endwith
>
>In your custom method you can check aQuery: an array of information about the current query.
>
>So you can check and see if that field was even used in the query.
>If so take the existing value, manipulate and replace it with the value you need. The following are the elements that you will need to work with.
>
>oQuery.aQuery[lnI, 3] = is the cFieldName
>oQuery.aQuery[lnI, 3] = is the Value
>
>You can see what is in this array by looking at the SFGetFilter.CreateArrayFromQuery().
>
>Thanks for you patience.
>
>Yuanitta Morhart
>Senior Developer
>Stonefield Systems Group Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform