PhoneMask ( Phone )
Phone mask as you type
			 
  
  
  
  Be the first to rate this function  Log in to vote
    Be the first to rate this function  Log in to vote		
| Omelyan Burtnyk            - Show more from this author Go To Logistics https://gotologistics.net | 
1234
1234567
(123) 4##-####
(123) 456-7###
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
			Note!: 
To move the cursor to the current position, 
I use the "Set Selection []" script step
Set Selection[ Table::Field1;  Start Position: ?;  End Position: ? ] 
Start Position: 
Let([ 
	~l = Length( Filter( Phone_Number::Phone; "0123456789" ));
	~startPosition = Case( 
		~l = 1; 3; 
		~l = 2; 4; 
		~l = 3; 5; 
		~l = 4; 8; 
		~l = 5; 9; 
		~l = 6; 10; 
		~l = 7; 12; 
		~l = 8; 13; 
		~l = 9; 14; 
		-1 
		)
	]; 
	~startPosition
	)
End Position: 
Let([ 
	~l = Length( Filter( Phone_Numbers::Phone; "0123456789" ));
	~endPosition = Case( ~l > 9; -1; 0 )
	]; 
	~endPosition
	)		
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.
