Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto generate data for TField

Status
Not open for further replies.

beginner81

Programmer
Oct 27, 2003
44
MY
I'm having the text file as following:

CUSTCODE CUSTNAME ADDRESS
"Cust001" "John" "AAA"
"Cust002" "Smith" "BBB"
"Cust003" "Alan" "CCC"
"CUST004" "David" "DDD"




So the form that i'm working with hav the following TLabel and TEDit componenets:

TLabel TEDIT
--------------------------
1)Cust Code TEdit1
2)CustName TEDit2
3)Address TEDit3


TEDit1 is enabled.. and user will enter the value they like in TEDit1... TEdit2 and TEdit3
is disabled.. the values for TEDit 2 and TEdit3 will displays automatically by the system
refering to the txt file given.. So let's say for example, when the users key in Cust002
to TEDit1, the system will generated autaomatically the value for TEDit2 and TEdit3, which
is "Alan" and "CCC" in this case.. so how am i going to do this??
 
Here's how:
Code:
1. Open the text file;
2. Look for the value entered in TEdit1.Text;
3. If Found, assign variables from the text file -
   Otherwise, assign blank values to the variables;
4. Close the text file;
5. Set TEdit1.Text and TEdit2.Text to the values.
Now if you have problems with any of these individual tasks, you can post a more specific question. [smile]

Good Luck!

 
Sorry mate.. I'm a newbie for delphi.. so can u provide me with the code?? thx ..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top