[texworks] SCRIPTS: TW.getItem() returning everything lower case?

Stefan Löffler st.loeffler at gmail.com
Thu Dec 9 08:04:50 CET 2010


On 2010-12-09 06:01, Paul A Norman wrote:
> Ok more accurate osilation of problem,
>
> There appears to be something about the way that the lists are built
> internally by recent versions of Qt perhaps.
>
> The behaviour is not fickle but seems to be predictable. It appears
> that it actually has nothing to do with uppercase / lowercase as such.
>
> If items in a list are case-insensitively the same, then the first
> occurrence of a common sequence of letters seems to typecast the rest
> - they are all recognised as the same.
>
> ["ABCD", "abcd","Abcd","ABCD", "Efgh"]
>
> First three elements are always coming out as ABCD
>
>
> [ "abcd","ABCD","Abcd","ABCD", "Efgh"]
>
> First three elements are always coming out as abcd
>
>
> ["Abcd", "abcd","ABCD","ABCD", "Efgh"]
>
> First three elements are always coming out as Abcd
>
>
> Efgh is always exactly as wanted, as there is no earlier occurance.
>
> Use this however
>
> ["Abcd","abcd","ABCD","ABCD","Efgh", "EFGH"]
>
> And try for EFGH and you'll get Efgh.

Hm, this is curious, and definitely sounds like a Qt bug (possibly in
the QtScript implementation?). As a workaround, did you try to build the
array differently? E.g., creating an empty array and adding elements one
by one (with v[0]=..., v[1]=..., etc.)? Maybe it has something to do
with the handling of all elements at once in the constructor...

HTH
Stefan


More information about the texworks mailing list