Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor pvumesh's Avatar
    Join Date
    Dec 2006
    Location
    Mumbai
    Posts
    84
    ok.. i have this peice of code wherein the bufer contents are written in the file located in C:\\mobinfo.txt

    case EGetCellId:

    buf.SetLength(0);
    if(iCellID().iCountryCode.Length()<(buf.MaxLength()-buf.Length()))
    {

    // buf.Append(_L("MCC: "));
    // buf.Append(iCellID().iCountryCode);
    buf.AppendFormat(_L("MCC: [%d]"),iCellID().iCountryCode);
    //buf.Append(_L("MNC: "));
    //buf.Append(iCellID().iNetworkIdentity);
    buf.AppendFormat(_L("MNC: [%d]"),iCellID().iNetworkIdentity);

    buf.AppendFormat(_L("LAC:[%d]"),iCellID().iLocationAreaCode);
    buf.AppendFormat(_L(" CI:[%d]"),iCellID().iCellId);
    }
    else
    buf.Append(_L("increase size of buf in CMobInfo::RunL"));

    LogToFile(buf);
    informationNote->ExecuteLD(buf);

    break;
    case ENotifyCellIdChange:

    buf.SetLength(0);
    if(iCellID().iCountryCode.Length()<(buf.MaxLength()-buf.Length()))
    {
    /*
    buf.Append(_L("MCC: "));
    buf.Append(iCellID().iCountryCode);
    buf.Append(_L("MNC: "));
    buf.Append(iCellID().iNetworkIdentity);
    */
    buf.AppendFormat(_L("LAC:[%d]"),iCellID().iLocationAreaCode);
    buf.AppendFormat(_L(" CI:[%d]"),iCellID().iCellId);
    LogToFile(buf);
    iRequest = ENoMobInfoRequest;
    IssueRequest(ENotifyCellIdChange);
    return;
    }
    else
    buf.Append(_L("increase size of buf in CMobInfo::RunL"));

    LogToFile(buf);
    informationNote->ExecuteLD(buf);

    break;

    This is the problem that i have....

    1. when it gets printed in the txt file i want it to print in this format..

    LAC:[value] CI:[value]
    LAC:[value] CI:[value]
    ....
    ....
    but the problem is that it goes on printing serially.....i tried putting \n and \r but doesnt seem to work...
    plz if anyone can help me out with this 1..

    With Regards,
    Mitesh Manani
    http://getpass.netfirms.com

  2. #2
    Super Contributor antonypr's Avatar
    Join Date
    May 2003
    Location
    Vancouver, Canada
    Posts
    985
    Have you tried with '\f'?

    Antony

  3. #3
    Regular Contributor pvumesh's Avatar
    Join Date
    Dec 2006
    Location
    Mumbai
    Posts
    84
    no...
    will try..
    just keep checking this 1...
    Thanks.

  4. #4
    Regular Contributor pvumesh's Avatar
    Join Date
    Dec 2006
    Location
    Mumbai
    Posts
    84
    hey thanks,
    i think it has worked out but maybe not that perfect coz.. when opened with notepad it shows the following o/p

    LAC:[1107] CI:[35421 LAC:[1107] CI:[35421 LAC:[1107] CI:[40942 LAC:[1107] CI:[35421 LAC:[1107] CI:[16283 LAC:[1107] CI:[35421 LAC:[1107] CI:[40942

    and when the same file is read with wordpad it shows the following o/p..

    LAC:[1107] CI:[35421
    LAC:[1107] CI:[35421
    LAC:[1107] CI:[40942
    LAC:[1107] CI:[35421
    LAC:[1107] CI:[16283
    LAC:[1107] CI:[35421
    LAC:[1107] CI:[40942

    either cases... the last closing square bracket seems to be missing...
    whats the reason for that ?

    With Regards,
    Mitesh Manani
    http://getpass.netfirms.com

  5. #5
    Super Contributor antonypr's Avatar
    Join Date
    May 2003
    Location
    Vancouver, Canada
    Posts
    985
    If you want to write to the file, you cannot use '\f' because Notepad or Wordpad will not recognize it. This character is used in several S60 UI components only.

    That's why, my suggestion is to differentiate the method that writes to the file and the UI.

    Antony

  6. #6
    Regular Contributor mollevp's Avatar
    Join Date
    Nov 2005
    Location
    Aalborg, Denmark
    Posts
    296
    Windows uses \r\n IIRC, so that should defenitely work in wordpad and notepad

  7. #7
    Nokia Developer Champion amitkankani's Avatar
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572
    right we need to append both "\r\n" to get it workin in notepad...
    Amit Kankani
    Nokia Developer Champion

  8. #8
    Regular Contributor pvumesh's Avatar
    Join Date
    Dec 2006
    Location
    Mumbai
    Posts
    84
    Thanks man...
    finally got the stuff to work...
    Actually what i developing is that the symbian application goes on putting the cellids in to the file... then the J2ME appliaton reads it and put is graphically onto the city map... so needed a bit of perfection in reading file.
    Anyways,
    Thanks once again.
    With Regards,
    Mitesh Manani
    http://getpass.netfirms.com

Similar Threads

  1. ERROR RCmake.exe AND rcomp.exe
    By jifik in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2005-10-31, 12:24
  2. Replies: 3
    Last Post: 2005-09-13, 05:37
  3. Errors compilling and debugging Helloworld
    By doberlet in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2004-03-04, 18:08
  4. Codewarrior import .mmp error
    By serenade in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2004-02-21, 20:06

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