Trying to search in a text field for a return character

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Trying to search in a text field for a return character

dealtek@gmail.com
Hi all,

fmp v16 on mac

Trying to use a script and search in a text field for a return character

Enter Find Mode [ ]
Set Field [ Contacts::Notes; Char ( 13 ) ]
Perform Find [ ]

or

Enter Find Mode [ ]
Set Field [ Contacts::Notes; Char ( 10 ) ]
Perform Find [ ]

or

Enter Find Mode [ ]
Set Field [ Contacts::Notes; "¶" ]
Perform Find [ ]


but they all show errors = find criteria not valid


---------


BTW: I can create another field then fill it if this scripted set field happens...

//works

set field x...

PatternCount ( Contacts::Notes ; Char ( 13 )  )


// and this works
PatternCount ( Contacts::Notes ; "¶"  )


but I don't want to create another field if I don't have to


Is there a way to get this search happening?




--
Thanks,
Dave - DealTek
[hidden email]
[db-18]

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Trying to search in a text field for a return character

Stephen Wonfor-3
> "\¶".  ?

Stephen

------------------
Sent using a device built by a popular California technology cult.

> On Mar 3, 2018, at 15:56, "[hidden email]" <[hidden email]> wrote:
>
> Hi all,
>
> fmp v16 on mac
>
> Trying to use a script and search in a text field for a return character
>
> Enter Find Mode [ ]
> Set Field [ Contacts::Notes; Char ( 13 ) ]
> Perform Find [ ]
>
> or
>
> Enter Find Mode [ ]
> Set Field [ Contacts::Notes; Char ( 10 ) ]
> Perform Find [ ]
>
> or
>
> Enter Find Mode [ ]
> Set Field [ Contacts::Notes; "¶" ]
> Perform Find [ ]
>
>
> but they all show errors = find criteria not valid
>
>
> ---------
>
>
> BTW: I can create another field then fill it if this scripted set field happens...
>
> //works
>
> set field x...
>
> PatternCount ( Contacts::Notes ; Char ( 13 )  )
>
>
> // and this works
> PatternCount ( Contacts::Notes ; "¶"  )
>
>
> but I don't want to create another field if I don't have to
>
>
> Is there a way to get this search happening?
>
>
>
>
> --
> Thanks,
> Dave - DealTek
> [hidden email]
> [db-18]
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Trying to search in a text field for a return character

Beverly Voth-3
In reply to this post by dealtek@gmail.com
Try escaping:
“\(pilcrow)”
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Trying to search in a text field for a return character

dealtek@gmail.com

> On Mar 3, 2018, at 3:18 PM, Beverly Voth <[hidden email]> wrote:
>
> Try escaping:
> “\(pilcrow)”


Hi Beverly - thanks for the help. Unfortunately that did not work for me.

However I found this old demo file that I got on the web a while back( don't know where )

I put it here...

http://filemakerbro.com/atemp/FindReturns.fmp12.zip

It uses an odd technique - that I don't quite understand - but it works!

Can anyone explain this cool technique?



Find Returns in Firstname

Set Variable [ $searchTerm; Value:Substitute( Quote( "1" ) ; "1" ; Right( LeftValues( 1; 1) ; 1)) ] Set Error Capture [ On ]
Enter Find Mode [ ]
Set Field [ FindReturns::Firstname; $searchTerm ]

Pause/Resume Script [ Duration (seconds): .5 ]
Perform Find [ ]






> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


--
Thanks,
Dave - DealTek
[hidden email]
[db-18]

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Trying to search in a text field for a return character

Mikey Songster
The "values" functions (e.g., left/right/middle/filtervalues) all return a paragraph delimited list where the last character is a <cr>.

Thus:
1) LeftValues( 1; 1) = 1<cr>
2) Right( LeftValues( 1; 1) ; 1) = <cr>
3) Quote( "1" ) = "1"
4) Substitute( Quote( "1" ) ; "1" ; Right( LeftValues( 1; 1) ; 1)) = "<cr>"

The end result ("<cr>") is how Filemaker finds a paragraph character in text.  The bottom line being that FMP doesn't like finding on a bare <cr>, it must be quoted to indicate literal text.

The following also works and is a little easier to read:

Enter Find Mode [ ]
Set Field [ FindReturns::Firstname ; "\"" & ¶ & "\"" ]
Perform Find [ ]

Both [ "\"¶\"" ] and [ "\"" & Char ( 13 ) & "\"" ] will also work, but [ Quote ( "¶" ) ] doesn't.  :-)

Good luck,

Mikey.


________________________________________
From: FMPexperts <[hidden email]> on behalf of [hidden email] <[hidden email]>
Sent: Saturday, March 3, 2018 4:37 PM
To: fmexperts
Subject: Re: Trying to search in a text field for a return character

> On Mar 3, 2018, at 3:18 PM, Beverly Voth <[hidden email]> wrote:
>
> Try escaping:
> “\(pilcrow)”

Hi Beverly - thanks for the help. Unfortunately that did not work for me.

However I found this old demo file that I got on the web a while back( don't know where )

I put it here...[...]

It uses an odd technique - that I don't quite understand - but it works!

Can anyone explain this cool technique?

Find Returns in Firstname

Set Variable [ $searchTerm; Value:Substitute( Quote( "1" ) ; "1" ; Right( LeftValues( 1; 1) ; 1)) ] Set Error Capture [ On ]
Enter Find Mode [ ]
Set Field [ FindReturns::Firstname; $searchTerm ]

Pause/Resume Script [ Duration (seconds): .5 ]
Perform Find [ ]

--
Thanks,
Dave - DealTek
[hidden email]
[db-18]



*******************************************************************
This email and any attachments are confidential. Any use, copying or
disclosure other than by the intended recipient is unauthorised. If
you have received this message in error, please notify the sender
immediately via +44(0)20 8943 7000 or notify [hidden email]
and delete this message and any copies from your computer and network.
LGC Limited. Registered in England 2991879.
Registered office: Queens Road, Teddington, Middlesex, TW11 0LY, UK
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|

Re: Trying to search in a text field for a return character

dealtek@gmail.com
Hi Mikey,

Thanks so much for the very clear explanation! You made it sooooo much easier to understand!


> On Mar 3, 2018, at 8:00 PM, Mikey Songster <[hidden email]> wrote:
>
> The "values" functions (e.g., left/right/middle/filtervalues) all return a paragraph delimited list where the last character is a <cr>.
>
> Thus:
> 1) LeftValues( 1; 1) = 1<cr>
> 2) Right( LeftValues( 1; 1) ; 1) = <cr>
> 3) Quote( "1" ) = "1"
> 4) Substitute( Quote( "1" ) ; "1" ; Right( LeftValues( 1; 1) ; 1)) = "<cr>"
>
> The end result ("<cr>") is how Filemaker finds a paragraph character in text.  The bottom line being that FMP doesn't like finding on a bare <cr>, it must be quoted to indicate literal text.
>
> The following also works and is a little easier to read:
>
> Enter Find Mode [ ]
> Set Field [ FindReturns::Firstname ; "\"" & ¶ & "\"" ]
> Perform Find [ ]
>
> Both [ "\"¶\"" ] and [ "\"" & Char ( 13 ) & "\"" ] will also work, but [ Quote ( "¶" ) ] doesn't.  :-)
>
> Good luck,
>
> Mikey.
>
>
> ________________________________________
> From: FMPexperts <[hidden email]> on behalf of [hidden email] <[hidden email]>
> Sent: Saturday, March 3, 2018 4:37 PM
> To: fmexperts
> Subject: Re: Trying to search in a text field for a return character
>
>> On Mar 3, 2018, at 3:18 PM, Beverly Voth <[hidden email]> wrote:
>>
>> Try escaping:
>> “\(pilcrow)”
>
> Hi Beverly - thanks for the help. Unfortunately that did not work for me.
>
> However I found this old demo file that I got on the web a while back( don't know where )
>
> I put it here...[...]
>
> It uses an odd technique - that I don't quite understand - but it works!
>
> Can anyone explain this cool technique?
>
> Find Returns in Firstname
>
> Set Variable [ $searchTerm; Value:Substitute( Quote( "1" ) ; "1" ; Right( LeftValues( 1; 1) ; 1)) ] Set Error Capture [ On ]
> Enter Find Mode [ ]
> Set Field [ FindReturns::Firstname; $searchTerm ]
>
> Pause/Resume Script [ Duration (seconds): .5 ]
> Perform Find [ ]
>
> --
> Thanks,
> Dave - DealTek
> [hidden email]
> [db-18]
>
>
>
> *******************************************************************
> This email and any attachments are confidential. Any use, copying or
> disclosure other than by the intended recipient is unauthorised. If
> you have received this message in error, please notify the sender
> immediately via +44(0)20 8943 7000 or notify [hidden email]
> and delete this message and any copies from your computer and network.
> LGC Limited. Registered in England 2991879.
> Registered office: Queens Road, Teddington, Middlesex, TW11 0LY, UK
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


--
Thanks,
Dave - DealTek
[hidden email]
[db-18]

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au