dbTalk Databases Forums  

Carriage returns

comp.databases.filemaker comp.databases.filemaker


Discuss Carriage returns in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Harvey Kliman
 
Posts: n/a

Default Carriage returns - 04-30-2005 , 11:26 AM






Hi helpful FileMaker experts:


I have two related questions:

How do I search for carriage returns in a field?

How do I prevent my staff from entering a carriage return in a field?



My problem stems from the fact that if a carriage return is added to a
name field it messes up later uses of that data (such as an address, etc.).


Please cc answers to my main email:

harvey.kliman (AT) yale (DOT) edu


Thanks as always for your help.

Harvey Kliman
Yale University School of Medicine


Reply With Quote
  #2  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: Carriage returns - 04-30-2005 , 11:49 AM






I would answer two ways :
1) to search for any 'odd' characters you may have it copied from Word
into a global or better into a common field in a one record file.
2) when using user entered data you may delete any miss used characters
before using it. Ie :
UserFieldBis = Substitute(Substitute(Substitute(UserField, "¶", ""); "
", " "); " ", " ")
Or else, have a message transparent on the top of the field : Message =
Case((PatternCount(UserField ; "¶" ) > 0; "Please withdraw any 'odd'
character from this entry", "").
Remi-Noel


"Harvey Kliman" <harveykliman (AT) mac (DOT) com> a écrit dans le message de news:
4273B1B9.8070106 (AT) mac (DOT) com...
Quote:
Hi helpful FileMaker experts:


I have two related questions:

How do I search for carriage returns in a field?

How do I prevent my staff from entering a carriage return in a field?



My problem stems from the fact that if a carriage return is added to a
name field it messes up later uses of that data (such as an address,
etc.).


Please cc answers to my main email:

harvey.kliman (AT) yale (DOT) edu


Thanks as always for your help.

Harvey Kliman
Yale University School of Medicine




Reply With Quote
  #3  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Carriage returns - 04-30-2005 , 11:54 AM



Add validation to the field definition to prevent entry of returns, as:
case(patterncount(NameField, "¶"), 0, 1)

This will fail the validation if it has a return character in it.

You can also copy a return from another field and paste it into your
find criteria within quotes.


Harvey Kliman wrote:
Quote:
Hi helpful FileMaker experts:


I have two related questions:

How do I search for carriage returns in a field?

How do I prevent my staff from entering a carriage return in a field?



My problem stems from the fact that if a carriage return is added to a
name field it messes up later uses of that data (such as an address, etc.).


Please cc answers to my main email:

harvey.kliman (AT) yale (DOT) edu


Thanks as always for your help.

Harvey Kliman
Yale University School of Medicine

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #4  
Old   
Marc-André Paiement
 
Posts: n/a

Default Re: Carriage returns - 04-30-2005 , 12:51 PM



Harvey Kliman wrote:
Quote:
Hi helpful FileMaker experts:


I have two related questions:

How do I search for carriage returns in a field?

How do I prevent my staff from entering a carriage return in a field?



My problem stems from the fact that if a carriage return is added to a
name field it messes up later uses of that data (such as an address, etc.).


Please cc answers to my main email:

harvey.kliman (AT) yale (DOT) edu


Thanks as always for your help.

Harvey Kliman
Yale University School of Medicine

Hi,

I don't think you can search for carriage returns. "¶" doesn't work for
instance. One workaround would be to create a calculation field =
PatternCount(field, "¶")and then search for records where this calc is > 0.

If you just want to clean up data already entered, however, there is no
need to find the set contaning returns. You can use the replace function
across the entire recordset, replacing the content of a field with a
calculation = substitute (field, "¶", " "): taht would replace every
return with a space instead. Obviously you have to do that for every
field that may contain unneeded returns.

You can prevent people from using carriage retuns in these fields with a
validation (under options for that field definition) by calculation,
such as PatternCount(field, "¶") = 0, and maybe display a custom mesage
if validation fails.

Just to make sure, I usually also clean up the data within calculations
that use these fields.

For instance, instead of:
first_name & " " & last_name & "¶" &
adress & ", " & city & "¶" &
etc.

I would use:
trim(substitute(substitute(first_name,"¶", " ")," ", "") & " " &
trim(substitute(substitute(last_name,"¶", " ")," ", "") & "¶" &
trim(substitute(substitute(adress,"¶", " ")," ", "") & ", " &
trim(substitute(substitute(city,"¶", " ")," ", "") & "¶" &
etc.

This removes leading and trailing spaces (trim), carriage returns (inner
substitution) and double spaces (outer substitution), either already
there or introduced by replacing returns with single spaces

You didn't sepcify which version you use, but with Filemaker 7, there
are other possibilities as well.

HTH

Marc-André Paiement



Reply With Quote
  #5  
Old   
Harvey Kliman
 
Posts: n/a

Default Re: Carriage returns - 05-03-2005 , 09:21 PM



Thank you, and thanks to you other helpful FM experts for assisting me.

Best wishes,

Harvey Kliman



Remi-Noel Menegaux wrote:
Quote:
I would answer two ways :
1) to search for any 'odd' characters you may have it copied from Word
into a global or better into a common field in a one record file.
2) when using user entered data you may delete any miss used characters
before using it. Ie :
UserFieldBis = Substitute(Substitute(Substitute(UserField, "¶", ""); "
", " "); " ", " ")
Or else, have a message transparent on the top of the field : Message =
Case((PatternCount(UserField ; "¶" ) > 0; "Please withdraw any 'odd'
character from this entry", "").
Remi-Noel


"Harvey Kliman" <harveykliman (AT) mac (DOT) com> a écrit dans le message de news:
4273B1B9.8070106 (AT) mac (DOT) com...

Hi helpful FileMaker experts:


I have two related questions:

How do I search for carriage returns in a field?

How do I prevent my staff from entering a carriage return in a field?



My problem stems from the fact that if a carriage return is added to a
name field it messes up later uses of that data (such as an address,
etc.).


Please cc answers to my main email:

harvey.kliman (AT) yale (DOT) edu


Thanks as always for your help.

Harvey Kliman
Yale University School of Medicine




--


Harvey J. Kliman, M.D., Ph.D.
Yale University School of Medicine
Reproductive and Placental Research Unit
Department of Obstetrics and Gynecology
333 Cedar Street, 312 FMB
New Haven, Connecticut 06520-8063
203 785-3854, 203 785-7642 (lab)
203 785-4477 (Fax); 203 387-6422 (Home Fax)
Text pager: 800 347-2574, PIN: 83369

http://info.med.yale.edu/obgyn/kliman
mailto:harvey.kliman (AT) yale (DOT) edu


"Behind every healthy baby is a healthy placenta"



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.