BJ> struct Table
BJ> {
BJ> char Title[30];
BJ> char SubTitle[35];
BJ> char Info1[40];
BJ> char Info2[40];
BJ> };
BJ>
BJ> Then.....
BJ>
BJ> Table.Title=Edit1->Text; (this line does not work )
BJ> (neither does using strcpy)
BJ>
BJ> I know that the editbox contains an ANSI string, but don't know how to
BJ> convert it to my table structure chars.
I don't have it on this machine, but if I remember well:
strncpy(Table.Title, Edit1->Text.c_str(), sizeof(Table.Title));
should work quite well... don't forget that the 'Text' member of Edit1
is a 'AnsiString' class, thus requires a conversion to be used like a
'normal' C null-terminated char array.
Bob
--- Maximus/2 3.01
---------------
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
|