My delphi help thread
Astalavista Forum Index :: Programming Solutions :: My delphi help thread
Post new topic   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Goto page Previous  1, 2, 3
Author Message
.:hybrid:.
Asta GFX Team
Asta GFX Team


Offline
No Image
Joined: 13 Mar 2008
Posts: 3902
Location: ♀

Reply with quote
No Image
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 Wow
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

_________________
View user's profile Send private message Visit poster's website
PostDate Posted:Mon May 04, 2009 8:43 pm
Thanks: 1376Thanked 2541 Times In 1014 Posts

Author Message
Saduff
Special Member
Special Member


Offline
No Image
Joined: 08 Dec 2008
Posts: 218
Location: CALL 0040627C

Reply with quote
No Image
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.

_________________


View user's profile Send private message
PostDate Posted:Mon May 04, 2009 9:03 pm
Thanks: 51Thanked 48 Times In 38 Posts

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


Offline
No Image
Joined: 13 Mar 2008
Posts: 3902
Location: ♀

Reply with quote
No Image
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?

_________________
View user's profile Send private message Visit poster's website
PostDate Posted:Mon May 04, 2009 9:12 pm
Thanks: 1376Thanked 2541 Times In 1014 Posts

Author Message
Saduff
Special Member
Special Member


Offline
No Image
Joined: 08 Dec 2008
Posts: 218
Location: CALL 0040627C

Reply with quote
No Image
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.

_________________


View user's profile Send private message
PostDate Posted:Mon May 04, 2009 9:43 pm
Thanks: 51Thanked 48 Times In 38 Posts

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


Offline
No Image
Joined: 13 Mar 2008
Posts: 3902
Location: ♀

Reply with quote
No Image
Haha I swear that wasn't working yesterday Liar

Thankyou Wow

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.

_________________
View user's profile Send private message Visit poster's website
PostDate Posted:Tue May 05, 2009 6:10 am
Thanks: 1376Thanked 2541 Times In 1014 Posts

Author Message
KenTheFurry
Special Member
Special Member


Offline
No Image
Joined: 11 Apr 2008
Posts: 408
Location: Michigan

Reply with quote
No Image
In Delphi 7 all you have to do is put a breakpoint(F5) somewhere inside of the code that you want to debug then run the program and when your program executes that bit of code it will pause then you can put your mouser over a variable and it will show you what is in it, or you can click it while debugging then click Ctrl+F7 and it will pop up a little box that lets you see what is in it. You can also F8 through the code but I don't know if it is the same for 10.

_________________
-KenTheFurry
View user's profile Send private message Visit poster's website MSN Messenger
PostDate Posted:Tue May 05, 2009 10:27 am
Thanks: 11Thanked 50 Times In 32 Posts

Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    Page 3 of 3 All times are GMT
Goto page Previous  1, 2, 3

Back to top


 
Astalavista Forum Index :: Programming Solutions :: My delphi help thread



Search This Topic:
Jump to:  
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


Powered by Astalavista.MS Team © 2004
Image Here Image Here Image Here