December 4, 200817 yr 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.
December 4, 200817 yr 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
December 4, 200817 yr 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/" )
December 5, 200817 yr Author 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 )
Create an account or sign in to comment