Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4123 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a field VALUE which I want to make singular only if it is already plural.

 

Example:  

Drivers should be Driver

NextOfKin should remain NextOfKin

...etc

 

I do not understand why this does not work:

 

Substitute ( Right ( "Drivers" ; 1 ) ; "s" ; "" )

 

Can someone explain to me why it does not work and what might work?  Thank you.

 

ps actually it would be the field instead of the text value "Drivers" but I should think it behaves the same for either since I can't get it to work for either.  

Posted
The first parameter of Substitute () is the text in which you want to perform the substitution. So your source string is only the "s", in which you substitute the search string "s" with "", and the result is an empty string.
 
Try 
Case ( Right ( myText ; 1 ) = "s" ; Left ( myText ; Length ( myText ) - 1 ) ; myText )
if in fact a trailing "s" guarantees multiplicity.
  • Like 1
Posted

Hi,

 

Thank you Eos, that is what I needed and I see my mistake now.  

 

You bring up a good point, Rick.  I do not see how one could possibly write a calculation which would handle it if it was Processes or some other plural which ends in s but doesn't end in consonant prior.   In my situation, I make sure that these items are named such that it isn't a problem.  I have

 

drivers

contracts

employees

rights

invoices

 

so I think I'm safe.  if there is way to protect in all cases, I would love to hear it though.  Thank you both for your assistance.

Posted

I do not see how one could possibly write a calculation which would handle it if it was Processes or some other plural which ends in s but doesn't end in consonant prior.

 

There are many more exceptions than that and it's not possible to handle them all without accessing a dictionary. That's not feasible within Filemaker - but might be possible using OS-level scripting or a plugin.

Posted

It probably would help if I indicated the purpose here.  I always name my tables in plural.  But in custom dialog I want to take the Source field which is the table name and show "You wish to change " & 'the single form of the source field' & $item.

 

this will be merge variable for modal dialog and dynamic message depending upon table being edited, just now working through how it will look.  In all, the calculation by Eos works on all my existing sources but you are right, Rick that I'll have to be careful.  

 

Hi Comment, this first project will be rough but I am learning a great deal by working it.  I am hoping to slide by using Eos' calc but I will turn to OS scripting or plugins if needed later (I know nothing about either).  I have decided to drop my indicated skill level to something more appropriate like beginner.  I read your work with awe.   :)

 

Thank you both very much.

This topic is 4123 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.