Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get data from Edit to Char array

34 views
Skip to first unread message

Dingus

unread,
Nov 5, 2004, 6:35:50 PM11/5/04
to
Hello,

I want to be able to enter data into an Editbox
and then store that data in a array[0..50] of char variable.

Any ideas?


Scott Gast

unread,
Nov 5, 2004, 6:45:38 PM11/5/04
to
Strings inside D8 are now objects, so you can do something like this:

var
strMyString: String;
arrChar: Array[0..49] of Char;
begin

strMyString := Copy(EditBox.Text,1,50);
arrChar := strMyString.ToCharArray;

end;

Hope this helps!

Scott


"Dingus" <din...@iniindabababa.co.zu> wrote in message
news:418c0e1b$1...@newsgroups.borland.com...

Dingus

unread,
Nov 5, 2004, 7:07:19 PM11/5/04
to
Thanks for info - I'm using D7 and it doesn't work :(

"Scott Gast" <Sc...@S2Software.com> wrote in message
news:418c10a5$1...@newsgroups.borland.com...

Joanna Carter (TeamB)

unread,
Nov 6, 2004, 3:07:42 AM11/6/04
to
"Dingus" <din...@iniindabababa.co.zu> a écrit dans le message de news:
418c157e$1...@newsgroups.borland.com...

> Thanks for info - I'm using D7 and it doesn't work :(

var


MyString: String;
arrChar: Array[0..49] of Char;

i: Integer;
begin
MyString := Copy(EditBox.Text,1,50);
arrChar := PChar(MyString);
end;

Joanna

--
Joanna Carter (TeamB)

Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker


Joanna Carter (TeamB)

unread,
Nov 6, 2004, 3:12:31 AM11/6/04
to
"Scott Gast" <Sc...@S2Software.com> a écrit dans le message de news:
418c10a5$1...@newsgroups.borland.com...

> Strings inside D8 are now objects, so you can do something like this:

Scott, this is the IDE general group, please don't assume folks are using
.NET; in fact they are more than likely not.

The original messages should really have been posted to either
..language.delphi.dotnet or ..language.delphi.Win32

Dingus

unread,
Nov 6, 2004, 4:00:18 PM11/6/04
to
Thanks for that Joanna, however it still doesn't appear to work.
I get the error message Incompatible types 'Array' and 'PAnsiChar'.
By the way, I notice you have declared i:integer; - is it perhaps suppoesed
to be used somewhere?

PS: Sorry if I chose the incorrect NG - should I place this posting in the
other?

"Joanna Carter (TeamB)" <joa...@btinternetxx.com> wrote in message
news:418c...@newsgroups.borland.com...

0 new messages