ecook Posted March 2, 2003 Posted March 2, 2003 I am trying to make a field that will make the name of a student possessive so their name can be used in a possessive form automatically. Is there a way to make a formula/function that will look at the name of a student, see if the last letter of their name is
BobWeaver Posted March 2, 2003 Posted March 2, 2003 I assume you must be American if that's how you denote possessive form. Anyway, try this: Name & Case(Right(Name,1)="s","'","'s") and for all the rest of the world: Name & "'s"
Vaughan Posted March 2, 2003 Posted March 2, 2003 I'd Trim() the Name field's contents to get rid of any training spaces that may accidentally be entered.
ecook Posted March 2, 2003 Author Posted March 2, 2003 First, I want to thank both of you for your time and the solution to my queston. This was my first post and your response was fast and wonderful Thank You! Next, what is a good book to aid in learning tricks like the one above? I have "FileMaker Pro" by Nolan Hester, "FileMaker Pro Advanced" by Cynthia L. Baron/Daniel Peck and "Learn FileMaker Pro" by Jonathan Stars. These seem to be good books but they seem to lack detailed explaniations on how all formulas/functions are used. Finally, the Trim() worked great on spaces but not returns. Is there a way to prevent an accidental return? Again, thank you very much for your help! Elgin Cook Alaska, USA
Lee Smith Posted March 2, 2003 Posted March 2, 2003 Hi Elgin, Welcome to the list. It appears that you have a good assortment of books, You might want to add one more called Special Edition Using FileMaker Pro 5, by Rich Coulombre and Jonathan Price. However, the best way to learn IMHO, is to get your hands on as many tip and trick, example, sample files, etc. that you can and then tear them appart to see what makes them tick. The second thing is to try and accomplish or make a sample file on what others on list(s), such as this, are asking, and then, compare your answer to what is given by others. The Third thing is, while you are developing solutions, do *NOT* hesitate to ask your questions here, and on the other FileMaker list that you belong to. If you need it, I can give you a list of sites (including here) for example files, and a list of other FileMaker lists you can join. Now to answer the question about the paragraph, Use the substitute step with the calculation: Trim(Substitute(Name, "?", "") & Case(Right(Name,1)="s","'","'s") ) HTH Lee
Lee Smith Posted March 2, 2003 Posted March 2, 2003 I should have tried this calculation before posting, there is an error in it, so don't use. Lee ;(
Lee Smith Posted March 3, 2003 Posted March 3, 2003 Hi Elgin, I came up with this calculation, only problem is that it breaks if the name ends in "S" and the user puts in a paragraph. I'm still working on it, however, maybe someone else can come up with something better for you. LeftWords(Trim(Name), WordCount(Trim(Name))) & Case(Right(Trim(Name),1)="s","'","'s") HTH Lee
Vaughan Posted March 3, 2003 Posted March 3, 2003 To remove paragraphs use this function: Substitute(textfield, "
Lee Smith Posted March 3, 2003 Posted March 3, 2003 Hi Vaughan, I tried that first and it wouldn't work with when coupled with the Trim and Case functions. Lee
Lee Smith Posted March 3, 2003 Posted March 3, 2003 Nope, tried that one too, and also breaks with the s ending names ;(
LaRetta Posted March 3, 2003 Posted March 3, 2003 Hi Elgin You are wise to question how to remove those pesky carriage returns!! I highly suggest you strip them from your text fields (except for multikey fields) during data-entry as they will cause problems for you in many ways. You can search for "Carriage Returns" on this Forum for a range of ideas on stopping them from being entered, and also how to strip them from your existing dBs. This Forum has been invaluable to me on this very issue. If you would more help on this subject after researching on Forum, post a new question and we'll help you with it. LaRetta
Vaughan Posted March 3, 2003 Posted March 3, 2003 Here is the function that strips returns, trims spaces and adds the apostrophe: Trim(Substitute(textfield, "
Ugo DI LUCA Posted March 3, 2003 Posted March 3, 2003 TEST = CASE in French. Sorry for that. Vaughan's is sweatest but this also works for what I've tested.
CobaltSky Posted March 3, 2003 Posted March 3, 2003 As a matter of interest (and at the risk of gilding Vaughan's lily), I'd make the following observations: 1. Nesting Substitute and Trim is redundant - the effect of both can be achieved simultaneously with the Xwords functions. 2. The use of Lower( ) is redundant, since boolean tests are not case sensitive. Thus a more compact expression which will achieve the desired outcome is: LeftWords(YourText, 99) & Left("'s", 2 - (Right(LeftWords(YourText, 99), 1) = "s")) The use of Left( ) rather than If( ) or Case( ) for the closing statement is, admittedly, purely arbitrary...
Ugo DI LUCA Posted March 3, 2003 Posted March 3, 2003 Hi Ray, I don't know how you can imagine such calculations , starting with Left and Leftwords when we are looking to correct the Right part of the Name . You may be a very complicated guy but it works great. Your solution not only "trim" spaces and carriage return at the end of the text field entry but also every clipboard of type "
Vaughan Posted March 3, 2003 Posted March 3, 2003 I hereby formally declare my lily well and truly gilded!
Lee Smith Posted March 3, 2003 Posted March 3, 2003 Hi Ray, Very niice, so smoooooooooooooth. At least I started out in the right direction using LeftWords. Thanks for the calculation, I know I'll have a use someday for this one. Lee
ecook Posted March 3, 2003 Author Posted March 3, 2003 Just a quick note to let all those who helped out in this. I truely appreciate it! I think I found the REAL place to learn. :-) Elgin
iSolve Posted March 11, 2003 Posted March 11, 2003 All this to have ownership..... Who'd have thunk it?
Recommended Posts
This topic is 7999 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 accountSign in
Already have an account? Sign in here.
Sign In Now