1982 Shares

How can i ask input from user using the tedit component in delphi?

How can i ask input from user using the tedit component in delphi? Topic: thesis assistance
June 20, 2019 / By Confucius
Question: Is there anyone out there who is a delphi programmer??? i really need your help... i will use this in our thesis, pleeeeease.......
Best Answer

Best Answers: How can i ask input from user using the tedit component in delphi?

Arin Arin | 10 days ago
Hi there, If you want to pop-up a message for the user, say to report an error or ask the user to do something they've forgotten to do, you can use the ShowMessage('Hello World!'); method. This is the same as other languages messaging such as Alert in Java. You'll need to ensure the unit uses Dialogs, but most do by default. I hope this helps, feel free to mail me at [email protected], should you need more assistance. na
👍 268 | 👎 10
Did you like the answer? How can i ask input from user using the tedit component in delphi? Share with your friends

We found more questions related to the topic: thesis assistance


Arin Originally Answered: How can i ask input from user using the tedit component in delphi?
Hi there, If you want to pop-up a message for the user, say to report an error or ask the user to do something they've forgotten to do, you can use the ShowMessage('Hello World!'); method. This is the same as other languages messaging such as Alert in Java. You'll need to ensure the unit uses Dialogs, but most do by default. I hope this helps, feel free to mail me at [email protected], should you need more assistance. na
Arin Originally Answered: How can i ask input from user using the tedit component in delphi?
If I am reading you right then simply either 1. At design time, use the Object Inspector and place in the "Text" property of the TEdit component something like "" or 2. At run time, create the FormCreate event and place one line of code "TEdit1.Text := ''; Hope this helps. This is basic programming. How much time have you spent learning Delphi?

Trudy Trudy
If I am reading you right then simply either 1. At design time, use the Object Inspector and place in the "Text" property of the TEdit component something like "" or 2. At run time, create the FormCreate event and place one line of code "TEdit1.Text := ''; Hope this helps. This is basic programming. How much time have you spent learning Delphi?
👍 110 | 👎 5

Trudy Originally Answered: How to write an Input Validation code using while Loop?
You should have gotten a bunch of compile errors with your code. E.g.: foo.cpp: In function `int main()': foo.cpp:7: error: redeclaration of `char letter' foo.cpp:6: error: `char letter' previously declared here foo.cpp:8: error: redeclaration of `char letter' foo.cpp:6: error: `char letter' previously declared here foo.cpp:9: error: redeclaration of `char letter' foo.cpp:6: error: `char letter' previously declared here foo.cpp:13: error: `Y' undeclared (first use this function) foo.cpp:13: error: (Each undeclared identifier is reported only once for each function it appears in.) foo.cpp:13: error: `y' undeclared (first use this function) foo.cpp:18: error: `N' undeclared (first use this function) foo.cpp:18: error: `n' undeclared (first use this function) ... a few hints that there's quite a bit wrong. Try this: #include #include #include #include #include using namespace std; char getChar(const string &prompt, const string &valid); const string validResp("yYnN"); int main(int argc, char *argv[]) {     char resp;     do {         resp = getChar("Continue? (y/n): ", validResp);     } while (tolower(resp) == 'y');     cout << "bye" << endl;     return 0; } char getChar(const string &prompt, const string &valid) {     string in;     size_t x;     cout << prompt;     do {         getline(cin, in);         if ((x = valid.find(in[0])) == string::npos) {             cout << "Invalid entry, enter one of: ";             copy(valid.begin(), valid.end(), ostream_iterator(cout, " "));             cout << endl << "> ";         }     } while (x == string::npos);     return in[0]; } #if 0 Sample run: Continue? (y/n): Y Continue? (y/n): y Continue? (y/n): x Invalid entry, enter one of: y Y n N > y Continue? (y/n): n bye #endif
Trudy Originally Answered: How to write an Input Validation code using while Loop?
This is the most basic and simplest way in my opinion on how to write an Input Validation While Loop: #include using namespace std; int main() { char letter; letter = 'Y', 'y', 'N', 'n'; cout << "Enter Y, y, N or n:\n"; cin >> letter; while (letter == 'Y' || letter == 'y') { cout << "Enter Y, y, N or n:\n"; cin >> letter; } while (letter == 'N' || letter == 'n') { cout << "Enter Y, y, N or n:\n"; cin >> letter; } cout << "You did not enter Y, y, N or n.\n"; return 0; }

If you have your own answer to the question thesis assistance, then you can write your own version, using the form below for an extended answer.