AnsweredAssumed Answered

WordCount function and text field with autoenter Get(UUID) returns result of 3

Question asked by itraining on Jul 1, 2014
Latest reply on Jul 1, 2014 by itraining

Hi everyone

 

In a new database I am finally making the switch from ID to UUID for the primary and foreign key fields. So it is out with the numerical autoenter serial number ID fields and in with text fields populated with the Get(UUID) function. Last year my very first attempt to populate a UUID field resulted in duplicate values and that scared me off the idea for a while. See February 2013 post below:

https://fmdev.filemaker.com/thread/69217

 

Question:

Why does the WordCount function return 3 when used on a text field populated with the Get(UUID) function?

 

Background:

Please view the attached screenshots for more information

The text field is populated with an autoenter Get(UUID) which returned E4D9F1B6-6133-4633-AEE0-D7B5D3F8E44D.

Using the WordCount() function returned a result of 3 words but I was expecting a result of 5 words.

 

The FileMaker help web page http://www.filemaker.com/help/11/fmp/html/func_ref3.33.89.html states:

"The ampersand and hyphen characters identify the beginning of a new word."


Some additional PatternCount(), Position() and Code() functions identified the separators as hyphens with Code() = 45.

The calculation to generate the feedback in the dialog box is below:

 

Let (

 

[

UUID = Observation::Observation_UUID ;

Hyphen = "-" ;

HyphenCount = PatternCount ( UUID ; Hyphen ) ;

Posn1 = Position ( UUID ; Hyphen ; 1 ; 1 ) ;

Code1 = Code ( Middle ( UUID ; Posn1 ; 1 ) ) ;

Posn2 = Position ( UUID ; Hyphen ; 1 ; 2 ) ;

Code2 = Code ( Middle ( UUID ; Posn2 ; 1 ) ) ;

Posn3 = Position ( UUID ; Hyphen ; 1 ; 3 ) ;

Code3 = Code ( Middle ( UUID ; Posn3 ; 1 ) ) ;

Posn4 = Position ( UUID ; Hyphen ; 1 ; 4 ) ;

Code4 = Code ( Middle ( UUID ; Posn4 ; 1 ) )

]

 

;

 

"Word Count = " & WordCount ( UUID ) & ¶ &

"Hyphen Count = " & HyphenCount & ¶ & ¶ &

"Hyphen 1:" & ¶ &

"Position = " & Posn1 & " Code = " & Code1 & ¶ &

"Hyphen 2:" & ¶ &

"Position = " & Posn2 & " Code = " & Code2 & ¶ &

"Hyphen 3:" & ¶ &

"Position = " & Posn3 & " Code = " & Code3 & ¶ &

"Hyphen 4:" & ¶ &

"Position = " & Posn4 & " Code = " & Code4 & ¶

 

)

 

 

 

 

Any help greatly appreciated.

Thanks in advance.

 

 

Michael Richards

Brisbane (Australia)

Outcomes