Hi,
Let me introduce myself please. I am Paul Norman, I work with TeXworks an
OpenSource development programme, http://code.google.com/p/texworks/ which
supplies QtScripting to its application model.
I have experienced a strange problem that might have been be QtScript
specific, I do not know.
Altering the generic String object to add a function .toTitleCase(), seemed
to change the array prototype as well, adding an extra element when you
tried to use a for (x in Y) loop on an Array Y. or the more traditional
fo(x=o; x < Y.length; x++) Y can be longer than you expected, and
an error results in the debugger.
This has stopped happening as a problem recently - I just wanted to know
please if it was a known issue that is now resolved in Qt 4.7...
String.prototype.hello = function(){
TW.information(null,"","Hello");
}
Y = ["a", "b", "c"];
TW.information(null,"", Y.length); // correct 3
"Try This".hello(); // ok - works as expected.
for ( x in Y)
{
TW.information(null,"", Y[x]);
}
// this has sometimes tried to give a fourth iteration, it is a fickle
problem
As I say, I think the problem no longer occurs, I just want to know if any
one knew about it before I commit myself to relying on it for safe practice.
Paul
_______________________________________________
Qt-script mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-script