FMPRO-L Archives

February 2011, Week 1

FMPRO-L@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stanley Weber <[log in to unmask]>
Reply To:
FileMaker Pro Discussions <[log in to unmask]>
Date:
Fri, 4 Feb 2011 09:05:41 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (87 lines)
Hi Rick

I add the following formula as an auto enter calculation to remove formatting, leading and trailing spaces, and all carriage returns.

TextFormatRemove ( Trim ( Substitute ( Self ; "¶" ; "" )))

Stan

||||||||||||||||||||||||||||||||||||||||||
Stanley S. Weber, Pharm.D., FASHP, BCPP
Associate Dean for Professional Pharmacy Education
University of Washington
PO Box 354699
Seattle, Washington 98105

[log in to unmask]
(206) 616-8762 (voice)
(206) 221-2689 (fax)
 

On Feb 4, 2011, at 8:25 AM, Rick O'Quinn wrote:

> I've got a few fields that I need to keep to one line, but not one word. Most are First Name, Last Name fields. I want to make sure users can't enter a carriage return OR any other random characters, such as another name. BUT entering 2 or more words (names) on one line is okay.... examples
> 
> I want to prevent this:
> John¶ (carriage return)
> Jimmy
> 
> And this:
> John¶ (carriage return)
> 
> But I want to allow this:
> Mary Alice
> 
> After digging around in the text functions for awhile, I didn't find an "out of the box" solution, so I searched Brian Dunnings Custom Functions list but couldn't find what I was looking for. I'm sure it's there and I just didn't hit the right search parameters.
> 
> Anyway, so I came up with my own custom function that is working.... since I'm not too good at righting those, so I was thrilled it worked. It might be a bit over blown with checking for 10 carriage returns, but I figured somebody's keyboard might get stuck. I threw in the trim after I got everything working to also get rid of leading/trailing spaces. The function below works, but I was wondering, is there an easier way to figure the number of words someone might throw in there? Like a >1 function? I tried that: ["¶"&RightWords ( TrimField ; >1 ) ; ""] but obviously the syntax isn't right.
> 
> Is there an easier way?
> 
> 
> Trim (
> 
> Substitute ( TrimField ;
> 
> 
> ["¶"&RightWords ( TrimField ; 10 );""];
> 
> ["¶"&RightWords ( TrimField ; 9 );""];
> 
> ["¶"&RightWords ( TrimField ; 8 );""];
> 
> ["¶"&RightWords ( TrimField ; 7 );""];
> 
> 
> ["¶"&RightWords ( TrimField ; 6 );""];
> 
> ["¶"&RightWords ( TrimField ; 5 );""];
> 
> ["¶"&RightWords ( TrimField ; 4 );""];
> 
> ["¶"&RightWords ( TrimField ; 3 );""];
> 
> ["¶"&RightWords ( TrimField ; 2 );""];
> 
> ["¶"&RightWords ( TrimField ; 1 ) ; ""];
> 
> ["¶" ; ""] ))
> 
> 
> 
> Thanks,
> 
> Rick
> ___________________
> Rick O’Quinn
> Photographic Services Coordinator
> University of Georgia
> Public Affairs
> Broadcast, Video & Photographic Services
> 188 Georgia Center
> Athens GA 30602-3603
> Work: (706) 542-8085
> Fax: (706) 583-0011
> [log in to unmask]
> http://www.photo.alumni.uga.edu

ATOM RSS1 RSS2