|
| Author |
Message |
.:hybrid:. Asta GFX Team



 Joined: 13 Mar 2008 Posts: 3902 Location: ♀
|
|
 |
| SerialKiller wrote: |
| Quote: |
Code:
public
{function ReverseString(const AString : string): string;}
end;
but when I use it, it says its undeclared so what am I doing wrong? |
Its a function of StrUtils
just add in the uses StrUtils
and call it like ReverseString(string)
u dont need to declare it |
Yes it worked
Thanks that had been bugging me for a while, I have only 1 more question that I can't solve myself yet, after this I think that I can figure the rest out myself.
How can I make it that when edit1.text is click it erases it's contents?
Because mine starts with 'name' in it, and when it gets clicked on I want it to dissapear instead of erasing it manually. Thanks |
_________________
|
|
Date Posted:Mon May 04, 2009 8:43 pmThanks: 1376Thanked 2541 Times In 1014 Posts
|
| Author |
Message |
Saduff Special Member



 Joined: 08 Dec 2008 Posts: 218 Location: CALL 0040627C
|
|
 |
You mean you want the 'name' still stored somewhere, but conceal it from the user? If that's the case, then I think you should use public variables:
Declare a public variable like this:
| Code: |
public
{ Public declarations }
str: String; // The previous code already exists, just add this |
And then use this code:
| Code: |
procedure TForm1.Edit1Click(Sender: TObject);
begin
str:= Edit1.Text;
Edit1.Clear;
end; |
This stores Edit1.Text in str, so you can use it wherever you like. |
_________________
|
|
Date Posted:Mon May 04, 2009 9:03 pmThanks: 51Thanked 48 Times In 38 Posts
|
| Author |
Message |
.:hybrid:. Asta GFX Team



 Joined: 13 Mar 2008 Posts: 3902 Location: ♀
|
|
 |
I had tried this earlier
Edit1.Clear;
I don't need it saved, so only that code is used.
yet got this message so I assumed it was wrong
But my code is
procedure TForm1.Edit1Change(Sender: TObject);
I can't make it click, only change, does that make a dif? |
_________________
|
|
Date Posted:Mon May 04, 2009 9:12 pmThanks: 1376Thanked 2541 Times In 1014 Posts
|
| Author |
Message |
Saduff Special Member



 Joined: 08 Dec 2008 Posts: 218 Location: CALL 0040627C
|
|
 |
It has to be Edit1Click. If it's Edit1Change, then when you enter something in the textbox, it will be cleared immediately. (you can't even type in the editbox and an error might occur)
Click on the Edit box so you can see the properties, then at the Object Inspector you can see 2 tabs.
Click on the Events tab and find OnClick and then double click on the combo box next to it.
Doing so should create the Edit1Click procedure, where you can type Edit1.Clear. |
_________________
|
|
Date Posted:Mon May 04, 2009 9:43 pmThanks: 51Thanked 48 Times In 38 Posts
|
| Author |
Message |
.:hybrid:. Asta GFX Team



 Joined: 13 Mar 2008 Posts: 3902 Location: ♀
|
|
 |
Haha I swear that wasn't working yesterday
Thankyou
Another newbish question, is it possible to see what each string contains in debug mode? I found something called CPU view but that was useless. |
_________________
|
|
Date Posted:Tue May 05, 2009 6:10 amThanks: 1376Thanked 2541 Times In 1014 Posts
|
Astalavista Forum Index :: Programming Solutions :: My delphi help thread
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|