×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Dec 2006
    Location
    Mumbai
    Posts
    84

    how to put a newline or a Enter character...

    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
    Join Date
    May 2003
    Location
    Vancouver, Canada
    Posts
    985

    Re: how to put a newline or a Enter character...

    Have you tried with '\f'?

    Antony

  3. #3
    Regular Contributor
    Join Date
    Dec 2006
    Location
    Mumbai
    Posts
    84

    Re: how to put a newline or a Enter character...

    no...
    will try..
    just keep checking this 1...
    Thanks.

  4. #4
    Regular Contributor
    Join Date
    Dec 2006
    Location
    Mumbai
    Posts
    84

    Re: how to put a newline or a Enter character...

    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
    Join Date
    May 2003
    Location
    Vancouver, Canada
    Posts
    985

    Re: how to put a newline or a Enter character...

    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
    Join Date
    Nov 2005
    Location
    Aalborg, Denmark
    Posts
    296

    Re: how to put a newline or a Enter character...

    Windows uses \r\n IIRC, so that should defenitely work in wordpad and notepad

  7. #7
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: how to put a newline or a Enter character...

    right we need to append both "\r\n" to get it workin in notepad...
    Amit Kankani
    Nokia Developer Champion

  8. #8
    Regular Contributor
    Join Date
    Dec 2006
    Location
    Mumbai
    Posts
    84

    Re: how to put a newline or a Enter character...

    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. Errors compilling and debugging Helloworld
    By doberlet in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2004-03-04, 18:08
  3. 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
  •  
×