View Full Version : JavaScript for loop won't work

15th October 2010, 20:16
The following code results in the error
Unexpected token `for'

I'm not a JavaScript expert, but it looks valid to me:

for (i=1;i<=10;i++)
// Do something

15th October 2010, 20:58
Is this the whole script?

15th October 2010, 21:23
My bad. From what I've heard on the DevDays, I just assumed that I could mix JavaScript and QML as I wanted. Wrapping it with a function does the trick.