Home > Archive > dBASE Questions and Answers > October 2006 > search for text occuring inside the field (cangetrow)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author search for text occuring inside the field (cangetrow)
Andry

2006-10-25, 7:34 am

Hi all,
I have been using cangetrow to filter records on a certain field that starts with certain words. for example:
rtest.cangetrow ={|| upper(this.fields["name"].value)="BOB" }
but that would result in records that starts with Bob.
Is there a way to search for the whole 'name' field so it does not matter where the occurence of 'bob' is. for example, StrangeBob (which has 'bob' at the end of the word/value).

I tried to use the '$' but it does not show any results (no matches).
rtest.cangetrow ={|| upper(this.fields["name"].value)$"BOB" }
Is there a limit to what Cangetrow can use for comparison operators that it does not work with '$'? is there another way? (I am trying to prevent reprograming the filter function)

as always, Thank you in advance.
Andry
Ken Mayer [dBVIPS]

2006-10-25, 7:34 am

Andry wrote:
> Hi all,
> I have been using cangetrow to filter records on a certain field that starts with certain words. for example:
> rtest.cangetrow ={|| upper(this.fields["name"].value)="BOB" }
> but that would result in records that starts with Bob.
> Is there a way to search for the whole 'name' field so it does not matter where the occurence of 'bob' is. for example, StrangeBob (which has 'bob' at the end of the word/value).
>
> I tried to use the '$' but it does not show any results (no matches).
> rtest.cangetrow ={|| upper(this.fields["name"].value)$"BOB" }
> Is there a limit to what Cangetrow can use for comparison operators that it does not work with '$'? is there another way? (I am trying to prevent reprograming the filter function)


You've got the syntax backward:

rtest.cangetrow ={|| "BOB" $ upper(this.fields["name"].value) }

if you think of the $ representing the text "contained in":

If "BOB" contained in upper(this.fields ....)

Hope that helps.

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Andry

2006-10-25, 7:34 am

Hi Ken,
Thank you.

Andry

Ken Mayer [dBVIPS] Wrote:

> Andry wrote:
>
> You've got the syntax backward:
>
> rtest.cangetrow ={|| "BOB" $ upper(this.fields["name"].value) }
>
> if you think of the $ representing the text "contained in":
>
> If "BOB" contained in upper(this.fields ....)
>
> Hope that helps.
>
> Ken
> --
> /(Opinions expressed are purely my own, not those of dataBased
> Intelligence, Inc.)/
>
> *Ken Mayer* [dBVIPS]
> /Golden Stag Productions/
> dBASE at goldenstag dot net
> http://www.goldenstag.net/dbase/dBASEBook.htm
> http://www.goldenstag.net/GSP
> http://www.goldenstag.net/dbase


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com