Re: TZF - Filters
David Langley <[email protected]> Tue, 9 Dec 2003 21:33:56 -0600
| Newsgroups | gmane.comp.lang.delphi.topaz |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. ------=_NextPart_000_000E_01C3BE9C.26ADB600 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi Bob, just a quick note to let you know I was finally able to get the filter to compile and actually work :-) I had to do as you did, break the lines of code down to make it a little more readable. Doing so made it easier to see where the errors were (syntax) types. The ' and " always give me problems with very long strings and many vars.. I haven't found anything on the max length of filter expressions but I'm sure I was approaching what ever it is :-) Again thanks for you help, and it you really did help with the example. Dave Langley ----- Original Message ----- From: Bob Watson To: [email protected] Sent: Wednesday, December 03, 2003 6:43 AM Subject: Re: TZF - Filters Can you provide an example of your code? The filter command looks like this: TzDBF1.SetFilterTo(s:string); To set three fields (say Name, Team, and BirthCity) in a filter when the values I want are in variables v1, v2, v3 I might do something like this _________________________________ var f:string; s1,s2,s3:string; s1:='Name="'+v1+'"; // You have to put the value of the // variable inside of " // and it takes a ' to do this s2:='Team="'+v2+"'; s3:='BirthCity="'+v3+"' f:=s1+' .AND. ' +s2+' .AND. '+s3; // then set the filter with TzDBF1.SetFilterTo(f); // You can certainly do the above in fewer lines (maybe one) but when // I do it in that way I always make a mistake. _________________________________ AND, normally when I set a complex filter, it does not work the first time and I have to tinker with it a little bit HTH, Bob ___________________________________ ----- Original Message ----- From: "David Langley" <[email protected]> To: <[email protected]> Sent: Monday, December 01, 2003 5:42 PM Subject: TZF - Filters > I'm having a trouble time trying to SetFilterTo for a datafile using > multiple vars derived from another datafile. I have to filter on at > least three fields. All fields are of type char, so either I'm not doing > something right in the filter itself, or going about it wrong. Any help > is appreciated.. I've been away from Topaz for a while now > :-) > > dgl-tts > > --^---------------------------------------------------------------- > --^---------------------------------------------------------------- This email was sent to: [email protected] EASY UNSUBSCRIBE click here: http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt Or send an email to: [email protected] TOPICA - Start your own email discussion group. FREE! http://www.topica.com/partner/tag02/create/index2.html --^---------------------------------------------------------------- ------=_NextPart_000_000E_01C3BE9C.26ADB600 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.2800.1276" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>Hi Bob, just a quick note to let you know I was finally able to get the filter to compile and actually work :-) I had to do as you did, break the lines of code down to make it a little more readable. Doing so made it easier to see where the errors were (syntax) types. The ' and " always give me problems with very long strings and many vars.. I haven't found anything on the max length of filter expressions but I'm sure I was approaching what ever it is :-) Again thanks for you help, and it you really did help with the example.</FONT></DIV> <DIV><FONT face=Arial size=2>Dave Langley</FONT></DIV> <BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV> <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A [email protected] href="mailto:[email protected]">Bob Watson</A> </DIV> <DIV style="FONT: 10pt arial"><B>To:</B> <A [email protected] href="mailto:[email protected]">[email protected]</A> </DIV> <DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, December 03, 2003 6:43 AM</DIV> <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: TZF - Filters</DIV> <DIV><BR></DIV>Can you provide an example of your code?<BR><BR>The filter command looks like this:<BR><BR> TzDBF1.SetFilterTo(s:string);<BR><BR>To set three fields (say Name, Team, and BirthCity)<BR>in a filter when the values I want are in variables<BR>v1, v2, v3 <BR>I might do something like this<BR>_________________________________<BR>var<BR> f:string;<BR> s1,s2,s3:string;<BR><BR><BR>s1:='Name="'+v1+'"; // You have to put the value of the <BR> // variable inside of " <BR> // and it takes a ' to do this<BR>s2:='Team="'+v2+"';<BR>s3:='BirthCity="'+v3+"'<BR><BR>f:=s1+' .AND. ' +s2+' .AND. '+s3;<BR><BR>// then set the filter with<BR><BR>TzDBF1.SetFilterTo(f);<BR><BR>// You can certainly do the above in fewer lines (maybe one) but when<BR>// I do it in that way I always make a mistake.<BR>_________________________________<BR><BR>AND, normally when I set a complex filter, it does not<BR>work the first time and I have to tinker with it a little bit<BR><BR>HTH,<BR>Bob<BR>___________________________________<BR><BR>----- Original Message ----- <BR>From: "David Langley" <<A href="mailto:[email protected]">[email protected]</A>><BR>To: <<A href="mailto:[email protected]">[email protected]</A>><BR>Sent: Monday, December 01, 2003 5:42 PM<BR>Subject: TZF - Filters<BR><BR><BR>> I'm having a trouble time trying to SetFilterTo for a datafile using <BR>> multiple vars derived from another datafile. I have to filter on at <BR>> least three fields. All fields are of type char, so either I'm not doing <BR>> something right in the filter itself, or going about it wrong. Any help <BR>> is appreciated.. I've been away from Topaz for a while now<BR>> :-)<BR>> <BR>> dgl-tts<BR>> <BR>> --^----------------------------------------------------------------<BR>> <PRE>--^^--------------------------------------------------------------- This email was sent to: [email protected] EASY UNSUBSCRIBE click here: <A HREF="http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt">http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt</A> Or send an email to: [email protected] TOPICA - Start your own email discussion group. FREE! <A HREF="http://www.topica.com/partner/tag02/create/index2.html">http://www.topica.com/partner/tag02/create/index2.html</A> --^^---------------------------------------------------------------</PRE> </BODY></HTML> ------=_NextPart_000_000E_01C3BE9C.26ADB600--