下面的程序出现的错误是
[Error] INPUTBOX.pas(36): '.' expected but '(' found   //光标停在inputbox的左括号后面
[Error] INPUTBOX.pas(37): '.' expected but '(' found
[Error] INPUTBOX.pas(38): '.' expected but '(' found
[Error] INPUTBOX.pas(38): There is no overloaded version of 'StrToFloat' that can be called with these arguments
[Error] INPUTBOX.pas(41): Incompatible types: 'String' and 'Integer'
[Error] INPUTBOX.pas(42): Incompatible types: 'String' and 'Extended'
[Fatal Error] Project_InputBox.dpr(5): Could not compile used unit 'INPUTBOX.pas'全部程序代码为:
unit INPUTBOX;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;type
  TForm1 = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}
uses QDialogs;procedure TForm1.Button1Click(Sender: TObject);
var
  Str1:string;
  Int1:integer;
  flo1:double;
begin
  Str1 := InputBox('输入窗口1','请输入字符串','默认的字符串');
  Int1 := StrToInt(inputbox('输入窗口2','请输入整数','123'));
  Flo1 := StrToFloat(inputbox('输入窗口3','请输入双精度实数','123.456'));
  label1.Caption:='测试输入窗口:'+#10#13+
                  '输入的字符串是:'+Str1+#10#13+
                  '输入的整数是:'+Int1+#10#13+
                  '输入的实数是:'+flo1;
end;
end.

解决方案 »

  1.   

    ....
                      '输入的整数是:'+InttoStr(Int1)+#10#13+
                      '输入的实数是:'+FloattoStr(flo1);
    ....
      

  2.   

    .... 
                      '输入的整数是:'+InttoStr(Int1)+#10#13+ 
                      '输入的实数是:'+FloattoStr(flo1); 
    .... 
     
    字符格式要转换的。在DELPHI里面输入的字符要按你的定义类型来转换的。建议你多看DELPHI的基础书籍。
      

  3.   

    学习  建议你多看DELPHI的基础书籍。
      

  4.   

      引号和逗号不能是中文的标点符号!
      Str1 := InputBox('输入窗口1','请输入字符串','默认的字符串'); 
      Int1 := StrToInt(inputbox('输入窗口2','请输入整数','123')); 
      Flo1 := StrToFloat(inputbox('输入窗口3','请输入双精度实数','123.456')); 
      label1.Caption:='测试输入窗口:'+#10#13+ 
                      '输入的字符串是:'+Str1+#10#13+ 
                      '输入的整数是:'+Int1+#10#13+ 
                      '输入的实数是:'+flo1; 
      

  5.   

      Str1 := InputBox('输入窗口1','请输入字符串','默认的字符串');
      Int1 := StrToInt(inputbox('输入窗口2','请输入整数','123'));
      Flo1 := StrToFloat(inputbox('输入窗口3','请输入双精度实数','123.456'));
      label1.Caption:='测试输入窗口:'+#10#13+
                      '输入的字符串是:'+Str1+#10#13+
                      '输入的整数是:'+IntToStr(Int1)+#10#13+
                      '输入的实数是:'+FloatToStr(flo1);注意类型的换转 IntToStr(Int1)+#  ;  FloatToStr(flo1);