帮忙解释一下下面两个inputQuery函数,最好举个例子.
function InputQuery(const ACaption, APrompt: WideString; var Value: Double, Min: Double = Low(Integer); Max: Double = High(Integer); Decimals: Integer = 1): Boolean; overload;function InputQuery(const ACaption, APrompt: WideString; var Value: Integer, Min: Integer = Low(Integer); Max: Integer = High(Integer); Increment: Integer = 1): Boolean; overload
;

解决方案 »

  1.   

    不会吧, 这也看不懂
    Call InputQuery to bring up an input dialog box ready for the user to enter a string, double, or integer in its edit box.ACaption is the caption of the dialog box.APrompt is the text that prompts the user to enter input in the edit box.Value is the value that appears in the edit box when the dialog box first appears and which returns the value that the user enters.AMin is the minimum value the user can enter into the edit box.AMax is the maximum value the user can enter into the edit box.Decimals does nothing.Increment controls the amount by which the value in the spin control changes when the user clicks the up or down arrow. (It has no effect on values that the user types).InputQuery returns true if the user chooses OK, and false if the user chooses Cancel or presses the Esc key.If a default value should be used when the user cancels out of the dialog, use InputBox instead.
      

  2.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      sAnswer: string;
    begin
      if InputQuery('提问', '1+1 = ?', sAnswer) then
        ShowMessage('Answer is ' + sAnswer);
    end;
      

  3.   

    implementation
    uses
      QDialogs;
    {$R *.dfm}
    procedure TForm1.Button1Click(Sender: TObject);
    var
      fAnswer: Double;
    begin
      if InputQuery('提问', '1+1 = ?', fAnswer) then
        ShowMessage('Answer is ' + FloatToStr(fAnswer));
    end;
      

  4.   

    怎么会不行, 看到第一行没有uses QDialogs;