Welcome Guest

Pages: 1
Dont seem to be able to go from uppercase to titlecase
cpkPostMarch 12, 2015, 23:33
Advanced
Posts: 95
Registered:
March 1, 2015, 02:55
Normal topicDont seem to be able to go from uppercase to titlecase

I'm not sure if this is by design, by my error, or by accident but I can't seem to be able to convert case from a string that is all uppercase to one that is in title case.

The action I am using to test this issue is as follows:

Comment The intention of this action is to test converting a field to title cast and removing non-alphanumeric characters.


Export name of User Defined Text Item MUSICBRAINZ_CATALOG_NUMBER (Case insensitive) to Variable2 (set state)
Dump snapshot variables. Show Action Test State. Prompt Exported field name.
if false
	Exit
endif
Copy the Variable 2 field to Variable 3
Trim Variable 3 (NL) (Punc) (Ctl) [Leading] [Trailing] [->SP]
Dump snapshot variables. Prompt After trim.
Case Title Case in Variable 3
Dump snapshot variables. Prompt After case conversion.
Import name of User Defined Text Item \V2 from Variable3
cpkPostMarch 12, 2015, 23:50
Advanced
Posts: 95
Registered:
March 1, 2015, 02:55
Normal topicRe: Dont seem to be able to go from uppercase to titlecase

Well I am pretty sure now that I am using the function correctly syntactically. The help says that it won't work if the word is mix of cases but doesn't say anything about uppercase. I've tested and found I can convert lowercase to titlecase so I guess the work-around is to convert to lowercase then to titlecase. Below is my action that has led me to this conclusion so far.

Comment The intention of this action is to test converting a field to title case.


Comment Test lowercase to titlecase
Export name of User Defined Text Item this is a lowercase test field (Create) to Variable2 (set state)
Dump snapshot variables. Show Action Test State. Prompt Exported field name.
Copy the Variable 2 field to Variable 3
Dump snapshot variables. Prompt After variable copy.
Case Title Case in Variable 3
Dump snapshot variables. Prompt After case conversion.
Import name of User Defined Text Item \V2 from Variable3

Comment Test uppercase to titlecase
Export name of User Defined Text Item THIS IS AN UPPERCASE TEST FIELD (Create) to Variable4 (set state)
Dump snapshot variables. Show Action Test State. Prompt Exported field name.
Copy the Variable 4 field to Variable 5
Dump snapshot variables. Prompt After variable copy.
Case Title Case in Variable 5
Dump snapshot variables. Prompt After case conversion.
Import name of User Defined Text Item \V4 from Variable5

Comment Test uppercase to lowercase to titlecase
Export name of User Defined Text Item THIS IS AN ANOTHER UPPERCASE TEST FIELD (Create) to Variable6 (set state)
Dump snapshot variables. Show Action Test State. Prompt Exported field name.
Copy the Variable 6 field to Variable 7
Dump snapshot variables. Prompt After variable copy.
Case lower in Variable 7
Dump snapshot variables. Prompt After lowercase conversion.
Case Title Case in Variable 7
Dump snapshot variables. Prompt After titlecase conversion.
Import name of User Defined Text Item \V6 from Variable7
2MR2PostMarch 13, 2015, 08:19
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe: Dont seem to be able to go from uppercase to titlecase

This is by design. The documentation could be improved. There are so many test points in Title Case. Words which are all upper case are not modified as there are far too many acronyms that should be all upper case. Getting this code to where it is was a long painful process 🙁

You've come upon the correct solution. If you don't want any all uppercase words, convert to lower case first.

cpkPostMarch 13, 2015, 18:53
Advanced
Posts: 95
Registered:
March 1, 2015, 02:55
Normal topicRe: Dont seem to be able to go from uppercase to titlecase

Ah, I understand now. It is just one more function so no big deal. But, yeah, it should say that in the documentation or at least make it a little clearer on what the limitations are for changes case. Thanks!

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.015 seconds.