March 10, 200421 yr Does anyone have a quicky way to get the first letter of every word of a string? My client insists on using a serial number with letters that represent the product. So, I need to take a string which could be 1, 2 or more words and take the first letter of every word and concatenate it with a incrementing serial number. i.e. Georgia Bulldogs = GB001, or Alabama Crimson Tide= ACT001 and so on. Any thoughts? Version: Developer v6 Platform: Windows XP
March 10, 200421 yr Here's one method. Just add your serial to the vlInitials field, and use a script to set a field with the result, if you need to have this field indexed. Kent.zip
March 11, 200421 yr Author Ok, looked at the attachment. Sorry, but still confused. Could you explain the significance of the repeating fields and the relationships you did? I my customer has 4000 records or so. I can't make a repeating field for that long. Couldn't I do this without the repeating field? Sorry about the confusion. Thanks
March 11, 200421 yr The repeating calculation field is specific to each record with a maximum (in the example) of 20 words. You can add/remove repetitions if you'll only have a max of 5 words per string or 25 words, etc. The repeating global index simply contains the consecutive numbers 1 - 20. The constant self-relationship is used to lookup the global index into a number field so that it can be indexed. The calculated repetition then uses this index to determine what value should result for each repetition. For the first five repetitions, Case(WordCount(Extend(text)) >= repIndex, Left(MiddleWords(Extend(text), repIndex, 1), 1)) would be similar to Case(WordCount(text) >= 1, Left(MiddleWords(text, 1, 1), 1)) & "
March 12, 200421 yr Author ah ha... Now this makes sense. Thanks so much... With regard to the serial numbers, the client only said that they use the incrementing numbers from each team name. in other words, if a team (Georgia Bulldogs) had 50 products, and another team (Northern Illinois Huskies) had 100 products, we would have serial numbers of GB050 and NIH100 repectively. So the next product for each team would be GB051 and NIH101. I'm not sure if this is easily done, if not, I don't see a problem with just adding a generalized record number to the Initials, After all, I don't think it will ever run into a repeat. If we do it like my client asks, if we have a team with the same initials, we will have the same serial number... NOT GOOD! I'll have to talk them out of their thoughts. Thanks so much for your help!
March 12, 200421 yr Then it would probably be easiest to create an auto-enter serial and append it to the end of the vlInitials calculation. The pleasure is mine.
Create an account or sign in to comment