CBuilder Edit1->Input of Char Array ?

This is a discussion on CBuilder Edit1->Input of Char Array ? within the Windows Programming forums, part of the Platform Specific Boards category; 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 ...

  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, 07:02 AM
  3. newbie needs help with code
    By compudude86 in forum C Programming
    Replies: 6
    Last Post: 07-23-2006, 09:54 PM
  4. code help required
    By Yobbo in forum C Programming
    Replies: 9
    Last Post: 09-03-2005, 12:15 AM
  5. Strings are V important...
    By NANO in forum C++ Programming
    Replies: 15
    Last Post: 04-14-2002, 12:57 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21