procedure TForm1.FormCreate(Sender: TObject);
beginmyini:=tinifile.Create('.\my.ini');
webbrowser1.Navigate(myini.ReadString('flash','路径','') );
timer1.Interval :=(myini.ReadInteger('time','hh','');
//timer1.Interval :=6000;[Error] Unit1.pas(47): Incompatible types: 'Integer' and 'String'

解决方案 »

  1.   

    myini:=tinifile.Create('.\url.ini');
    webbrowser1.Navigate(myini.ReadString('flash','路径','') );
    timer1.Interval :=myini.ReadInteger('time','时间',0);我这样写.它又对了。搞不清楚是什么原因.请高手解答.谢谢
      

  2.   

    timer1.Interval是整型类型的
    myini.ReadInteger( 'time ', '时间',0),这个没有相应的值的时候就取这个默认值0,所以是正确的
    而timer1.Interval :=(myini.ReadInteger( 'time ', 'hh ', ' '),这个没有相应的值的时候取的默认值是'',所以错误。所说的相应值是指,ini文件中time(section),时间(ident)对应的值帮助文件:
    function ReadInteger(const Section, Ident: String; Default: Longint): Longint;DescriptionCall ReadInteger to retrieve an integer value from a specified data value associated with a key.Section is a string that identifies the key from which to retrieve a data value. Ident is a string that identifies the name of the data value to return. Default is an integer value to use if there is no key corresponding to Section or no data value corresponding to Ident.Note: This function overrides the ReadInteger function of TRegistry, from which TRegIniFile is derived. To call the ReadInteger function of TRegistry instead of this function, cast the call to ReadInteger as TRegistry.
      

  3.   

    谢谢。弱弱的在问问你
    procedure TForm1.FormCreate(Sender: TObject);
    begin
    progressbar1.Min :=0 ;
    progressbar1.Max :=100;
    for i:= 1 to 100 do
       begin
       progressbar1.Position :=i;为什么这里滚动条不会出现滚动效果,按下F9之后,滚动条直接显示到100 呢.
      

  4.   


    ProgressBar1.Position:=0;
    progressbar1.Max:=100; 
    for   i:=   1   to   100   do 
    begin 
      ProgressBar1.StepBy(1);
    end;ProgressBar1.Position:=0;