Jun 22
Rev. Steve Willis Custom function problem
Jun 22, 2010; 18:26
Rev. Steve Willis
Custom function problem
Hi, all!
I wrote an FM custom function to escape straight and curly single & double quotes. It is to be used when porting records from FMP to MySQL because their presence crashes FMS10 whenever it hits them.
The function is called fn_EscForMySQL( text ). It is defined as follows:
Let([
esc_apostrophe = Char(92) & Char(39);
esc_quote = Char(92) & Char(34);
quote = Char(34);
apostrophe = Char(39) ;
curly_ldblquote = Char(210);
curly_rdblquote = Char(211);
curly_lsngquote = Char(212);
curly_rsngquote = Char(213)];
Substitute( text ; [ apostrophe ; esc_apostrophe ] ;
[ quote ; esc_quote ] ;
[ curly_ldblquote ; esc_quote ] ;
[ curly_rdblquote ; esc_quote ] ;
[ curly_lsngquote ; esc_quote ] ;
[ curly_rsngquote ; esc_quote ] )
)
I created a calc field to test the function where the original last a curly single quote (OÂ’Brian), but it doesn't change it to O\'Brian like it should.
100% Mac environment, no Windows systems involved.
I used an ASCII table to determine the single- and double-byte character numbers. Does FMP use something other than standard MacRoman double-bye chars? If so, how can I find the ones it uses? Is there anything wrong with my code?
Thanks!!!!
Steve
--
Rev. Steve Willis
Director of Software Development
Life Christian University
P.O. Box 272360
Tampa, Fl 33688
(520) 891-3721
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/FileMaker/Browse/
Manage your subscription: http://www.ListSearch.com/FileMaker/
Jun 22
Tom Fitch Re: Custom function problem
Jun 22, 2010; 19:44
Tom Fitch
Re: Custom function problem
Jun 22
Drew Tenenholz Re: Custom function problem
Jun 22, 2010; 19:49
Drew Tenenholz
Re: Custom function problem
Jun 23
Rev. Steve Willis Re: Custom function problem
Jun 23, 2010; 13:52
Rev. Steve Willis
Re: Custom function problem
Jun 23
Drew Tenenholz Re: Custom function problem
Jun 23, 2010; 14:34
Drew Tenenholz
Re: Custom function problem