Mike CPB Posted December 4, 2008 Posted December 4, 2008 I have many clients, and often new clients are within the same area, perhaps the same street. I'm making a script that will duplicate & replace the digits of the street, but leave the rest. I'm using Set Variable $Leftword and insert calculated result. For the moment it works just fine... but there are times when Digits might not be the first item in the address field and its obviously removing the leftword. Is it possible to evaluate the global variable? Maybe my logic is off but ≥ 1 isn't working. ( I think it is just counting the items in the global variable ) Still new to filemaker. Regards, Mike.
Søren Dyhr Posted December 4, 2008 Posted December 4, 2008 Well if I get your problem right here, could it be done this way: Trim(Filter ( Lower ( theRoadAddress ) ; " abcdefghijklmnopqrstuvwxyz" )) Returning in a field formatted as titlecase... Please observe the before the "a" --sd
comment Posted December 4, 2008 Posted December 4, 2008 I'd be careful with that filter - because street names can contain digits as well (not to mention other characters besides plain ASCII). How about testing for something like: LeftWords ( Address ; 1 ) = Filter ( LeftWords ( Address ; 1 ) ; "0123456789/" )
Mike CPB Posted December 5, 2008 Author Posted December 5, 2008 Ended up going with isNumeric calculation http://www.fmforums.com/forum/showtopic.php?tid/188600/ Thanks for the idea's. Let ( [ trimmedValue = Trim( $Leftword ) ; filteredValue = Filter( trimmedValue ; "0123456789.-" ) ; lengthOk = Length(trimmedValue ) = Length( filteredValue ) ; dotOccurrence = PatternCount( filteredValue ; "." ) ; dotOk = ( dotOccurrence = 0 ) or ( dotOccurrence = 1 ) ; minusOccurrence = PatternCount( filteredValue ; "-" ) ; minusIndex = Position(filteredValue ; "-" ; 1 ; 1) ; minusOk = Case( minusOccurrence = 0 ; 1 ; minusOccurrence = 1 and minusIndex = 1 ; 1 ; 0 ) ] ; lengthOk and dotOk and minusOk )
Recommended Posts
This topic is 5892 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now