| View previous topic :: View next topic |
| Author |
Message |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Thu Jul 12, 2007 11:21 am Post subject: [Delphi] [Help] Reading Info in a Text Box |
|
|
Well, I have had past experiences programming in C#, and I'm taking on Delphi now.
What I would like to know is how to extract information from a Text Box.
In C#, it would be something like
| Code: |
string a = textBox1.Text;
|
And I understand that in Delphi I would have to do something like
| Code: |
procedure whatever
var
string a;
begin
a := RichEdit1.Text
end;
end.
|
Or something, but it gives me an error when I do that. I have searched many websites to try to figure this out, but all searches have come up empty. Could someone help?
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Thu Jul 12, 2007 11:22 am Post subject: |
|
|
| what error did you get?
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Thu Jul 12, 2007 11:26 am Post subject: |
|
|
Err, it said something like "Undeclared identifier a", and "Identifier expected, but A found".
But by changing it to
It worked.
~~
Note to self, Delphi and C are VERY different. x-x
Edit:
Getting another error when I try:
| Code: |
procedure whatever
var
a : string;
begin
a := 'Hehe Waffles';
if (RichEdit1 <> a)
then ShowMessage('d00d');
end;
end.
|
It says that STRING and TRICHEDIT are incompatible types.
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Thu Jul 12, 2007 11:30 am Post subject: |
|
|
they're very different languages
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Thu Jul 12, 2007 11:32 am Post subject: |
|
|
| you want the text from the rich edit: RichEdit1.Text
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Thu Jul 12, 2007 11:33 am Post subject: |
|
|
| appalsap wrote: | | you want the text from the rich edit: RichEdit1.Text |
Thank you very much! Though it seems like a bit of a careless mistake on my part. Oh well :roll:
|
|
| Back to top |
|
 |
|