Forums

OverviewV-Play 1 SupportIs there a maximum size for imported Javascript? › Reply To: Is there a maximum size for imported Javascript?

OverviewV-Play 1 SupportIs there a maximum size for imported Javascript? › Reply To: Is there a maximum size for imported Javascript?
#7089

Rohan

Thanks for the info, Christian.  I’ll follow up with the Qt team at some point.  For the time being, I got it working by converting it to JSON, and using FileUtils to read it.  The code if anyone is interested:

 

Component.onCompleted: {
    var wordListUrl = Qt.resolvedUrl("Data/YAWL.json");
    wordList = JSON.parse(fileUtils.readFile(wordListUrl.toString()));
}

function doesWordExist(word) {
    if (wordList.indexOf(word.toLowerCase()) >= 0) {
        return true;
    }

    return false;
}

The check function is actually really slow, and your plan of splitting it up is definitely the way to go.  Creating an indexed hash would speed it up immensely, I’m thinking.

 

Once I get a utility for breaking the index down, I’ll post that as well.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support