View Full Version : QTScript - checking variable names?

12th June 2009, 12:29
i'm relatively new to QT and i can't seem to find this point in the qtscript documentation,
we are using qtscript to let users write their own script files which are then evaluated and converted to the corresponding functions, however if someone makes a typo if he tries to execute a function in this script files a new variable is created with that name.

is it possible to include a function in the qtscript parser which scans variable names? i only need to know where or if i can do that, probably someone knows the answer already.

thanks! (search function did not help :()

15th June 2009, 19:40
In ECMAScript variable declaration is implicit so it would be hard to change that behaviour automatically. You can parse the script yourself before passing it to QScriptEngine::evaluate() though.