2 Replies Latest reply on Aug 29, 2016 3:10 PM by wendy

    Using Patterncount with Get HostName

    wendy

      Our server is currently named "FMS13".  In Data Viewer, why would #1 below return 1, while #2 below returns 0?

       

      #1

      PatternCount ( "FMS13" ; Get ( HostName ) )

       

      #2

      PatternCount ( "FMS" ; Get ( HostName ) )

       

      The only difference between the two is that #1 is looking for the pattern "FMS13", while #2 is looking only for "FMS".

       

      Background: A previous programmer hard-coded a lot of custom Set Window Title script steps--but still wanted the server name to be in the title when served:

      Set Window Title [If ( Get ( HostName ) = "FMS13"; "Detail (FMS13)"; "Detail" )]

       

      However, we will be updating our server (planning to change the name to the generic "FMS"), and want to get rid of the hard-coded version reference in scripts. I've been experimenting with

      If (PatternCount ( "FMS" ; Get ( HostName ) ) >0; "Detail " &  "(" & Get ( HostName ) & ")"; "Detail" )

       

      Mac OS 10.9.3 running Filemaker Server 13.0.1 with Pro13 and Advanced13 clients.

       

      Thank you.