Results 1 to 2 of 2

Thread: QTScript - checking variable names?

  1. #1
    Join Date
    Jun 2009
    Qt products

    Red face QTScript - checking variable names?

    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 )

  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    Default Re: QTScript - checking variable names?

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.

Similar Threads

  1. QPSQL problem
    By LoneWolf in forum Installation and Deployment
    Replies: 60
    Last Post: 4th November 2009, 14:22
  2. QtScript access variable from C++
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2009, 23:51
  3. nmake error during .pro compiling
    By mattia in forum Installation and Deployment
    Replies: 5
    Last Post: 18th June 2008, 10:15

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.