×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    2

    String Format problem

    [FONT="Arial Narrow"]Hi ,
    I am a newbie to this,I was trying to format a string using Format(I read its the equivalent to the sprintf).But some where i got an error. Please guide me to solve this error, while looking to the code. Whether I had any mistake in its method.[/FONT]

    Code:
    typedef struct _PARSEGPGGA
          {
    	TUint satTime;
    	TReal64 latitude;
    	TChar latDir;
    	TReal64 longitude;
    	TChar longDir;
    	TInt8 gpsQuality;
    	TInt8 noOfSat;
    	TInt8 hzonDilution;
    	TReal32 altitude;
    	TChar altUnit;
    	TReal64 ellisoidSep;
    	TChar ellipUnit;
           } PARSEGPGGA;
           		
           PARSEGPGGA ggaData;
    ........................
    ..........
    _LIT(KGPGGA,"$GPGGA,%u,%f,%c,%f,%c,%d,%d,%d,%f,%c,%f,%c,,,\n");
    
    .........
    ........
    TBuf8<200> GpsBuff;
    
    GpsBuff.Format(KGPGGA,ggaData.satTime,ggaData.latitude,ggaData.latDir,
                 gaData.longitude,ggaData.longDir,ggaData.gpsQuality,
             ggaData.noOfSat,&ggaData.hzonDilution,&ggaData.altitude,
    	ggaData.altUnit,ggaData.ellisoidSep,ggaData.ellipUnit);
    
    .........
    .........
    while compiling I got one error

    1245700729296 error: no matching function for call to `TBuf8<200>::Format(const TLitC<47>&, TUint&, TReal64&, TChar&, TReal64&, TChar&, TInt8&, TInt8&, TInt8*, TReal32*, TChar&, TReal64&, TChar&)'

    Please help me to solve this.
    Thanks in advance
    Geo

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: String Format problem

    Hi,

    _LIT(KGPGGA,"$GPGGA,%u,%f,%c,%f,%c,%d,%d,%d,%f,%c,%f,%c,,,\n");
    The above line should be like
    _LIT8(KGPGGA,"$GPGGA,%u,%f,%c,%f,%c,%d,%d,%d,%f,%c,%f,%c,,,\n");
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    2

    Smile Re: String Format problem

    Hi,
    Yes...really That helped me a lot... thank u...

    Now can we write this buf into a file ....

    .....
    ...
    file.Write(GpsBuff);


    regards,
    geo

  4. #4
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: String Format problem

    Hi,

    Yes you can write it into the file also. if you need example you can check wiki.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

Similar Threads

  1. Replies: 2
    Last Post: 2008-12-25, 12:41
  2. urgent problem: file format unknow for xhtml
    By mingl in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2006-02-15, 08:16
  3. 9210 Communicator reset or format problem
    By akuroda in forum Symbian
    Replies: 1
    Last Post: 2004-08-14, 02:03
  4. A problem about the string and the color
    By wangdongjing in forum Mobile Java General
    Replies: 1
    Last Post: 2004-04-20, 13:03
  5. Sound format problem !!!!!
    By GaryWu in forum Mobile Java General
    Replies: 0
    Last Post: 2002-12-28, 20:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×