Thread: CBuilder Edit1->Input of Char Array ?

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    21

    Question CBuilder Edit1->Input of Char Array ?

    I`m using a rutine that works fine using this char array.

    char Data[8]={'-','1','3','4','5','6','7'};

    I`d like to enter these chars through a TextField,
    in this form :
    -1345676
    I know of :

    var=Edit1->Text.ToInt()

    but how do I get single chars out of this input?

    Thanks for your help!

  2. #2
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    Edit1->Text returns a string object called AnsiString. If you look in the help pages for AnsiString you'll see it has an operator for accessing individual characters.

    So you could do this:

    char c3 = Edit1->Text[3];

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 11-17-2008, 12:36 PM
  2. C++ ini file reader problems
    By guitarist809 in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2008, 06:02 AM
  3. newbie needs help with code
    By compudude86 in forum C Programming
    Replies: 6
    Last Post: 07-23-2006, 08:54 PM
  4. code help required
    By Yobbo in forum C Programming
    Replies: 9
    Last Post: 09-02-2005, 11:15 PM
  5. Strings are V important...
    By NANO in forum C++ Programming
    Replies: 15
    Last Post: 04-14-2002, 11:57 AM