TextStyleAdd - what am I missing?
Why do I not see a capitalized string in the dialog box?
Set Variable [$a; Value:TextStyleAdd("hithere"; Uppercase)]
Show Custom Dialog [$a]
Folks, we found a bug in the recent format change (that was not requested by FileMaker, just forced on us by RightNow). Post #11 will not be visible until post #12 is made. Sad but true. We've reported the issue so maybe they'll fix it. (post 21, 31, etc. likely has the same issue...)
Why not dispense with the Set Variable and just type "HI THERE" in the Custom Dialog? Note that neither Variables, nor Custom Dialog Messages retain other text formatting (such as Bold, Italic or Underline, etc.), so if you want to display these other types of formatting, you may need to create a custom layout (see example below).
Hi Spruce Gum,
I guess my example was not well placed. I have a table which I use for a value list. It is the states of the U.S. The user can add to this list. In case the user supplies a lower case state, I the software to ensure it becomes uppercase.
So in pseudo code:
get state from user and put into a temp global field via a dialog
goto state value list table and add new record
setfield(newrecordstatefield; TextAddStyle(temp global field; Uppercase))
So far, so good. When I examine the value list table all is well, the state is there and it is upper case. I use a pull down menu to display a state from the value list in the layout where a state must be in a record field. The pull down menu shows a lower case state even though when I examine the table via its own default layout, the state is capitalized. If I enter the state in caps, then the pulldown shows it as caps. What's wierder is that the menu shows a lower case, but when I select that LC value from the pull down, it appears upper case after being copied into the field! I tried a window refresh - nada.
One of those days....
When you want the input in uppercase, then change it to uppercase, do not just simply format it as uppercase.
Set Field [TableName::newrecordstatefield; Upper ( temp global field )]
What you do now is giving a format to the state name. The valuelist doesn't look at formatting. That's a good thing when users do the input themselves. They could as well make it red or size 128.
OK. Then it might be easiest to define the text field <State> using the following Auto-Enter Calculation:
And de-select "Do not replace existing value for field (if any)"
I tried that after my last posting (I am not sure I understand the difference between addtextstyle(fname, Uppercase) and Upper(fnam), but I tried both).
Again, a view of the table of states shows all caps, but the pull down on the layout that uses the list shows lower, however, when copied into the state field, they are upper case...arghhhh.
AddTextStyle does not change the actual data, but it ... well ... adds a text style.
Upper () calculates a new value, in this case "name" is changed to "NAME".
If your field is set up to display whatever its contents are with style 'upper', then you see uppercase, but you don't really know what the real value is.
What might be confusing is, that uppercase in most applications is not a style. In FileMaker however it is.
Also, in desparation, using the 10,000 monkey technique, I used the inspector and chose style->upper case while the state field was selected in the layout editor - no cigar, the pull down list is lower case.
Here is another perlexing observation: I go to the table containing the states. They are all upper case as I mentioned earlier. I select and cut a value say, "CA". I then type in "CA" again, and lo & behold, "CA" shows up capitalized in the pull down menu....????? Note that it was capitalized before I cut it and ditto after I re-entered it by hand, but before the cut and change, the pull down showed lower case, and after the cut and change it shows upper even though the table was effectivily unchanged.
Maybe you should read my posts.
ok, stupid question, why not just include all states in value list, they aren't likely to increase in number any time soon, formatted as desired ...or are you forcing users to add their state - why?
> Maybe you should read my posts.
I did read your post and commented that it was the right answer. I have no clue where my earlier comment went which was made and posted early in the afternoon that your answer was perfect, but I cannot find it.
There is something happening with the forums. I just got an email from "symbister - FileMaker Forums firstname.lastname@example.org" about adding all the states and I come here to find it is not posted so there is something happening with the timing of the posts and it may be why I did not see your earlier post.
Thanks again for the info - it really helped.
They're on page 2
Philmodjunk - thanks!
I thought I was going crazy.
BTW, I put in a request for a documentation change to highlight the semantics between AddTextStyle and Upper/Lower. Perhaps I missed something in the docs/help, but I came across AddTextStyle first and assumed it would work and it does not for reasons others have said, but one sentence in the doc would have prevented my asking to begin with. If there is another place in the documentation that describes this subtelty, please tell me to RTFM, but give a pointer.
Thanks so much for all your help - all of you!
If you click to page two and see only the original post plus the one accepted as best answer, post a reply and when your screen updates, post #11 will be visible.
Retrieving data ...