×

Discussion Board

Results 1 to 2 of 2

Thread: TBuf to TInt?

  1. #1
    Super Contributor
    Join Date
    Mar 2003
    Posts
    2,426

    TBuf to TInt?

    Hi!

    I've written a little game in C++. It has a toplist file. I store the names and the scores it this file. How can I read the scores as TInt datas? I use TFileText for the read, and read the datas to TBUfs. How can I convert the TBuf type into TInt? Any idea?
    Thx for the answers!

    Posted by Toth Lorant, tothl@netforum.hu
    on April 08, 2002 at 12:12

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Posts
    2,426

    RE: TBuf to TInt?

    Posted by Asheesh Sangamneheri, asangamneheri@hotmail.com
    on April 08, 2002 at 12:32



    hi,
    use TLex to convert char to numbers. refer sdk help for details. hope the example also helps...

    cheers,
    ash

    //--------------------------------------------
    TBuf8<10>temp;
    TLex8 conv; // used to convert TBuf8<> to TInt
    TInt num;

    ReadFile.Read(temp);
    conv=fromfile.Mid(0,3); // read uid
    conv.Val(num); // num=conv=temp;

Posting Permissions

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