Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to get user input

Posted on 1998-07-08
2
Medium Priority
?
221 Views
Last Modified: 2010-04-04
I want to use inputbox to get user information
how can i ?
i´m using Delphi 3.02
0
Comment
Question by:vis
2 Comments
 
LVL 1

Accepted Solution

by:
Marcius earned 60 total points
ID: 1357304
function InputBox(const ACaption, APrompt, ADefault: string): string;

Example:

MyUserDate := InputBox('Login To Server','Username: ','');

This will prompt the user and allow them to enter some data. Once they press the OK button, the function will return to the calling program and your variable will contain the data.
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1357305
or use InputQuery, From Delphi Help file:

This example uses a button and a label on the form. When the user clicks the button, the input box displays. If the user chooses OK, the string that appears in the edit box of the dialog box displays as the caption of the label on the form. If the user chooses Cancel, the dialog box closes and the caption of the label remains unchanged.

procedure TForm1.Button1Click(Sender: TObject);

var
  NewString: string;
  ClickedOK: Boolean;
begin
  NewString := 'Default String';
  Label1.Caption := NewString;
  ClickedOK := InputQuery('Input Box', 'Prompt', NewString);
  if ClickedOK then                 { NewString contains new input string }
    Label1.Caption := 'The new string is ''' + NewString + '''';
end;
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question