1 2 Previous Next 17 Replies Latest reply on Feb 28, 2012 9:49 AM by philmodjunk

    TextStyleAdd - what am I missing?

    dzittin

      Title

      TextStyleAdd - what am I missing?

      Post

      Why do I not see a capitalized string in the dialog box?

      Set Variable [$a; Value:TextStyleAdd("hithere"; Uppercase)]

      Show Custom Dialog [$a]

       

      TIA,

      -D

       

        • 1. Re: TextStyleAdd - what am I missing?
          Sprucegum

          Hi Dzittin,

          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).

          • 2. Re: TextStyleAdd - what am I missing?
            dzittin

            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....

            -D

            • 3. Re: TextStyleAdd - what am I missing?
              hbrendel

              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.

              • 4. Re: TextStyleAdd - what am I missing?
                Sprucegum

                Hi D,

                OK.  Then it might be easiest to define the text field <State> using the following Auto-Enter Calculation:

                    Upper(State)

                And de-select "Do not replace existing value for field (if any)"

                • 6. Re: TextStyleAdd - what am I missing?
                  dzittin

                  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.

                  -D

                  • 7. Re: TextStyleAdd - what am I missing?
                    hbrendel

                    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.

                    HTH

                    • 8. Re: TextStyleAdd - what am I missing?
                      dzittin

                      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.

                      • 9. Re: TextStyleAdd - what am I missing?
                        dzittin

                        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.

                        -D

                        • 10. Re: TextStyleAdd - what am I missing?
                          hbrendel

                          Maybe you should read my posts.

                          • 11. Re: TextStyleAdd - what am I missing?
                            dzittin
                            Got it! I apologize for not seeing Hbrendel's earlier post - he had the answer. That's confusing stuff and really should be part of the documentation for TextStyleAdd...IMHO.
                             
                            Thanks hbrendel!
                            -D
                            • 12. Re: TextStyleAdd - what am I missing?
                              symbister

                              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?

                              • 13. Re: TextStyleAdd - what am I missing?
                                dzittin

                                 > 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 noreply@hivelive.com" 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.

                                -D

                                • 14. Re: TextStyleAdd - what am I missing?
                                  hbrendel

                                  They're on page 2

                                  1 2 Previous Next