7 Replies Latest reply on May 14, 2010 5:47 AM by dsdsdsdsd

    director converting symbol's case from lower to upper

    dsdsdsdsd Level 1

      put symbol("bd") -- BD

       

       

      any thoughts as to why this would happen?

       

      it only happens every now and then, even though I am running the same .dir file;

       

      furthermore it is not converting every lowercase string to uppercase;

        • 1. Re: director converting symbol's case from lower to upper
          Sean_Wilson Adobe Community Professional

          Previously in the Director file (or maybe the "session") you have created a symbol with the case the string is converted to. Never rely on case for symbols - they are completely case-insensitive anyway

          • 2. Re: director converting symbol's case from lower to upper
            dsdsdsdsd Level 1

            Sean, what exactly is a "session";

             

            over the last month it seems that my.dir every now and then without any apparent catalyst gets hung up on #bd ==> #BD;

             

            however, there is not any hardcoded symbol that uses 'bd' or 'BD';

             

             

             

            once #bd is converted to #BD it throws an error beacuse:

            my_prop = symbol( #bd )

            put my_prop  -- BD


            my_var = my_list[ my_prop ] -- error ... does not exist for #BD, but does exist for #bd.

             

            although the documents clearly state "Lingo does not distinguish between uppercase and lowercase when referring to cast members,  variables ..."

             

            but in my case Lingo is distinguishing!! as best as I can tell;

             

             

             

            I believe that possibly 3DPI may be a part of this with regards to maybe maintaining a previousely dynamically defined #bd, which might be the 'session'; but I cannot imagine where the capital letters are coming from;

            • 3. Re: director converting symbol's case from lower to upper
              Sean_Wilson Adobe Community Professional
              Sean, what exactly is a "session";

              By 'session' I meant the period of time from when you open the authoring environment until when you close it again. This can include opeing and working on any number of different files.

               

              once #bd is converted to #BD it throws an error beacuse:

              my_prop = symbol( #bd )

              put my_prop  -- BD


              my_var = my_list[ my_prop ] -- error ... does not exist for #BD, but does exist for #bd.

              Presumably you mean

              my_prop = string(#bd)
              put my_prop
              -- "BD"
              

              Again, you should not rely on symbols having a particular case. Can you explain why you start with a symbol, convert it to a string and use this as a name in a property list? Why not stick with strings or symbols throughout without converting?

              • 4. Re: director converting symbol's case from lower to upper
                dsdsdsdsd Level 1

                well, this is simply an illustrative example of what is occurring;

                 

                 

                what is actually occurring is:

                 

                my_prop_A = my_list_A.getPropAt( i )

                my_value  = my_list_B[ my_prop_A ] --- error occurrs here

                 

                 

                my_list_A is created at runtime from an external text file with ONLY lowercase letters;

                my_list_A looks like: [#a : "something" , #aa : "something" , #ab : "something" , ... , #bd : "something" , ... ]

                at this point I obviousely wondered if there was in fact an #BD within my_list_A ... maybe some type of anomoly conversion; however, there is nothing;

                 

                so if I:

                put symbol("aa") -- #aa

                put symbol("bd") -- #BD

                 

                once this happens it throws an error because there is no my_list_B[ #BD ] ( though there is a #bd );

                 

                in order to fix it I do all kinds of stuff, and there is no consistency to achieving the solution; on any given day this might work:

                    --    close the 3dpi
                    --    delete w3d and text files which have data that is used to build my_list_A
                    --    recompile scripts
                    --    save and compact
                    --    close director
                    --    restart my computer
                    --    open director
                    --    re-import w3d and text files which have data that is used to build my_list_A

                but then on any other day that same set of steps might not work; some times I go through this same process 4 or five times, and then all of the sudden it works;

                 

                etc. with other solution approaches;

                • 5. Re: director converting symbol's case from lower to upper
                  Mike Blaustein Level 4

                  Or, you could just not use symbols in your proplist.  You can use strings as the property name instead of symbols.  It works exactly the same and doesn't have the case-sensitivity issues.

                   

                  If your list is something like:

                   

                  myList[#aa]="something"

                  myList[#bd]="somethingElse"

                   

                  you would change it t:

                   

                  myList["aa"]="something"

                  myList["bd"]="somethingElse"

                   

                  The issue is in the symbol table that Director uses.  It starts off with a few prebuilt symbols, then adds new ones as you create them.  So the first time that you use #aa, it will add that to the table.  And it is not possible to change it from then on without a hex editor and a lot of spare time.  It is a hold over from the bad old days when string comparisons were really slow.  Symbol comparisons are much faster, with the obvious provision of the case sensitivity that you need to deal with.  With modern computers, the difference is so marginal that it doesn't matter, therefore, I would use strings whenever possible.

                  • 6. Re: director converting symbol's case from lower to upper
                    dsdsdsdsd Level 1

                    interesting ... thanks for that insight;

                     

                    currently my_list_A is being built like this:

                    setAProp   value(  string_var_a  ) ,  value(  "#" & string_var_b )  ,  [ : ] 

                    which is what you said, of course;

                     

                    I will leave it like that for now; I'm sure within the next couple of weeks I will run into that error again; then I will try:

                    setAProp   value(  string_var_a  ) ,  string_var_b   ,  [ : ] 

                     

                    thanks,

                    Shannon

                    • 7. Re: director converting symbol's case from lower to upper
                      dsdsdsdsd Level 1

                      it worked ...

                       

                      changing:

                      setAProp   value(  string_var_a  ) ,  value(  "#" &  string_var_b )  ,  [ : ] 

                       

                       

                      to:

                      setAProp    value(  string_var_a  ) ,  string_var_b   ,  [ : ] 

                       

                       

                      many thanks;