Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User prodigy47's Avatar
    Join Date
    Oct 2011
    Posts
    76
    hi all,
    anybody can help me?

    i want to write a text file in my directory ("MyDocs/Documents/"). how can i do this in JavaScript or QML?

    i coded my example project in QML.

    my javascript code:

    function writeFile(sData)
    {

    var fso = new fopen("Scripting.FileSystemObject");
    var fh = fso.CreateTextFile("/home/user/MyDocs/Documents/example.txt", true);
    fh.WriteLine(sData);
    fh.Close();

    }


    but that code now working

    best regards.

  2. #2
    Nokia Developer Moderator gnuton's Avatar
    Join Date
    Mar 2009
    Posts
    1,024
    JS has been created for web and it cannot access to the disk for security reasons!
    Do you want to save file on the disk then you need to write a small class in C++ and interface it in QML.

  3. #3
    Registered User prodigy47's Avatar
    Join Date
    Oct 2011
    Posts
    76
    how can i do?
    can u show me an example?

    thanx for reply.
    best regards.

  4. #4

  5. #5
    Registered User prodigy47's Avatar
    Join Date
    Oct 2011
    Posts
    76
    thanks a lot @gnuton
    u r awesome.

    i am trying now.
    best regards.

  6. #6
    Registered User prodigy47's Avatar
    Join Date
    Oct 2011
    Posts
    76
    i tried this way.

    but qt turns that error:
    main.cpp: In function 'int main(int, char**)':
    main.cpp:10: error: 'qmlRegisterType' was not declared in this scope
    main.cpp:10: error: expected primary-expression before ',' token
    main.cpp:10: warning: left-hand operand of comma has no effect
    main.cpp:10: warning: right-hand operand of comma has no effect
    main.cpp:10: warning: right-hand operand of comma has no effect
    main.cpp:10: error: ISO C++ forbids comparison between pointer and integer


    best regards.
    Last edited by prodigy47; 2011-11-30 at 01:22.

  7. #7
    Nokia Developer Moderator gnuton's Avatar
    Join Date
    Mar 2009
    Posts
    1,024
    #include <QDeclarative> is missing in your code.

  8. #8
    Registered User www.rzr.online.fr's Avatar
    Join Date
    Feb 2004
    Location
    france/rennes
    Posts
    73
    I have to do that for redak text editor ... opensource

    http://rzr.online.fr/q/redak
    http://rzr.online.fr/q/redak# redak-0.4.0-0 : #FreE #TexT #EditoR : #Qt #QmL ported to #SymbiaN #BellE (#E7) and !n950club #n9 #MeeGo, test

Similar Threads

  1. How to create text file by J2ME ?
    By Vinit410 in forum Mobile Java General
    Replies: 18
    Last Post: 2012-07-24, 05:36
  2. How to create a text file in j2me...please help !
    By lakshmicse in forum Mobile Java General
    Replies: 1
    Last Post: 2011-01-24, 19:47
  3. how to create text file
    By sulabh120881 in forum Mobile Java General
    Replies: 7
    Last Post: 2007-08-13, 07:05
  4. Create a text file
    By jesusdol in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-10-17, 04:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved