打印本文 打印本文 关闭窗口 关闭窗口
计算器(加了个小数点)。。。
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2387  更新时间:2009/4/23 18:26:49  文章录入:mintao  责任编辑:mintao
bsp;       end;

       if s_characterlast=''''+'''' then
        begin
            edit1.Text:=floattostr(strtofloat(s_number) + strtofloat(edit1.Text ));
            s_number:=edit1.text;
            s_characterlast:=''''-'''';
            i:='''''''';
       end;

        if s_characterlast=''''-'''' then
       begin
            edit1.Text:=floattostr(strtofloat(s_number) - strtofloat(edit1.Text ));
            s_number:=edit1.text;
            s_characterlast:=''''-'''';
            i:='''''''';
       end;

        if s_characterlast=''''/'''' then
         begin
             edit1.Text:=floattostr(strtofloat(s_number) / strtofloat(edit1.Text ));
             s_number:=edit1.text;
             s_characterlast:=''''-'''';
            i:='''''''';
         end;
   end
//**************//
    else
        begin
           s_characterlast:=''''-'''';
           s_number:=edit1.Text;
            i:=''''432423'''';
        end;
    j:=''''3432'''';
end;

procedure TForm1.Button14Click(Sender: TObject);
begin
  s_type:=''''0'''';
  if  s='''''''' then

    application.MessageBox(''''请先输入数字'''',''''提示:'''',0)
else
  if  i<>'''''''' then
  begin
        if s_characterlast=''''X'''' then
         begin
            edit1.Text:=floattostr(strtofloat(s_number) * strtofloat(edit1.Text ));
            s_number:=edit1.text;
            s_characterlast:=''''X'''';
            i:='''''''';
        end;

       if s_characterlast=''''+'''' then
        begin
            edit1.Text:=floattostr(strtofloat(s_number) + strtofloat(edit1.Text ));
            s_number:=edit1.text;
            s_characterlast:=''''X'''';
            i:='''''''';
       end;

        if s_characterlast=''''-'''' then
       begin
            edit1.Text:=floattostr(strtofloat(s_number) - strtofloat(edit1.Text ));
            s_number:=edit1.text;
            s_characterlast:=''''X'''';
            i:='''''''';
       end;

        if s_characterlast=''''/'''' then
         begin
             edit1.Text:=floattostr(strtofloat(s_number) / strtofloat(edit1.Text ));
             s_number:=edit1.text;
             s_characterlast:=''''X'''';
            i:='''''''';
         end;
   end
//**************//
    else
        begin
           s_characterlast:=''''X'''';
           s_number:=edit1.Text;
            i:=''''34342'''';
        end; 
    j:=''''3432'''';
end;

procedure TForm1.Button15Click(Sender: TObject);
begin
  s_type:=''''0'''';
  if  s='''''''' then
    application.MessageBox(''''请先输入数字'''',''''提示:'''',0)
else
  if  i<>'''''''' then
  begin
        if s_characterlast=''''X'''' then
         begin
            edit1.Text:=floattostr(strtofloat(s_number) * strtofloat(edit1.Text ));
            s_number:=edit1.text;
            s_characterlast:=''''/'''';
            i:='''''''';
        end;

       if s_characterlast=''''+'''' then
        begin
            edit1.Text:=floattostr(strtofloat(s_number) + strtofloat(edit1.Text ));
            s_number:=edit1.text;
            s_characterlast:=''''/'''';
            i:='''''''';
       end;

        if s_characterlast=''''-'''' then
       begin
            edit1.Text:=floattostr(strtofloat(s_number) - strtofloat(edit1.Text ));
            s_number:=edit1.text;
            s_characterlast:=''''/'''';
            i:='''''''';
       end;

        if s_characterlast=''''/'''' then
         begin
             edit1.Text:=floattostr(strtofloat(s_number) / strtofloat(edit1.Text ));
             s_number:=edit1.text;
             s_characterlast:=''''/'''';
            i:='''''''';
         end;
   end
//**************//
    else
        begin
           s_characterlast:=''''/'''';
           s_number:=edit1.Text;
            i:=''''3432'''';
        end;
    j:=''''3432'''';
end;

procedure TForm1.Button17Click(Sender: TObject);
begin
close;
end;

procedure TForm1.Button16Click(Sender: TObject);
begin
if s_type=''''1'''' then
  if (edit1.Text='''''''')   then
  begin
  edit1.Text:=edit1.Text+''''0.'''';
  s:=''''123'''';
  j:=''''''''; end
  else
  begin
  edit1.Text:=edit1.Text+''''.'''';
  s:=''''123''''; end
else  begin
  if (j<>'''''''') then
  begin
  edit1.text:='''''''';
  edit1.Text:=edit1.Text+''''0.'''';
   s_type:=''''1'''';
  j:='''''''';
  end else
  begin
  edit1.text:='''''''';
  edit1.text:=edit1.Text+''''.'''';
  s_type:=''''1'''';
  end;
end;
end;

procedure TForm1.Button11Click(Sender: TObject);
begin
//=======================================//
    s_type:=''''0'''';
  if  s='''''''' then

    application.MessageBox(''''请先输入数字'''',''''提示:'''',0)
    else
     if  s_characte

上一页  [1] [2] [3]  下一页

打印本文 打印本文 关闭窗口 关闭窗口