I.T. Discussion Community!
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

September Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPascal and Delphi Coding BoardDelphi Object PASCAL Topic   Print This     

simple function

simple function in Delphi Object PASCAL topic (part of our Pascal and Delphi Coding group).

Quick Search: function   simple function  
newbie
-- USA
Hey all, I am quite new to programming (Delphi6 particularly) and need help with a simple function.
I have many editboxes on my form, and would like to create a function that I could call everytime someone enters text in the edit box. I would like this function to chuck this text into a TStringlist that I have created. That part I have, but if someone could provide me with a view of code for the function declaration and implementation, I would greatly appreciate it.

radiobutton1
Choice : TStringlist;

Thanks in advance.

-Newbie
 Posted 17 years ago (Thread Starter)
Comment Quote
About newbie -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #8632, 2 replies
Thread Started 12/12/2002 6:16:00 PM
View Counter=2099
Last Reply Posted 12/13/2002 9:34:00 AM)
Location=-- USA 
Joined=17 years ago   MB Posts=1  
Scott Wehrly
Prestwood IT
 (Inactive)
Las Vegas, NV USA
This was in the Just Conversation forum.
 Posted 17 years ago
Comment Quote
About Scott Wehrly -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #8645 (Level 1.1)  Reply to 8632
Thread Started 12/13/2002 8:03:00 AM
View Counter=2
Location=Las Vegas, NV USA 
Joined=17 years ago   MB Posts=442   KB Posts=19  
Most Recent Post
Scott Wehrly
Prestwood IT
 (Inactive)
Las Vegas, NV USA
Okay, I had Joy move this into the appropriate forum. Now for the reply...





Typically, what you're attempting is done in an event on the Edit control. I'll assume that the controls you're talking about are all TEdit controls, and proceed from there.



Here's a sample of event code:

procedure TForm1.Edit1Exit(Sender: TObject);
begin
if TEdit(Sender).Text <> '' then
StringList1.Add(TEdit(Sender).Text);
end;


Note that the event is the "OnExit" event of the control. Many "newbies" are tempted to use the "OnChange" event, but soon find out that the event gets triggered on every keystroke, which defeats the purpose.



So, you want to trigger the event when the user stops typing. "Clever" coders might try to capture every keystroke and wait for the Tab or Enter key, but that's not as clean a solution as the OnExit event, which happens when the user tabs or clicks out of the control.



Build an event like my example in one edit control, then assign the name of that event to the "OnExit" event of all of the other edit controls (the name will appear in the drop-down editor on that event in the Object Inspector).
 Posted 17 years ago
Comment Quote
About Scott Wehrly -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #8647 (Level 1.2)  Reply to 8632
Reply Posted 12/13/2002 9:34:00 AM
Location=Las Vegas, NV USA 
Joined=17 years ago   MB Posts=442   KB Posts=19  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1195A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #8632 Counter
2099
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech