小编Edi*_*vic的帖子

运算符不适用于此操作数类型Delphi

有人帮我解决这个错误.

[错误] Unit1.pas(39):运算符不适用于此操作数类型

代码是:

procedure TForm1.Button1Click(Sender: TObject);
var
  k: Integer;
  broj: Real;
begin
  k := StrToInt(Edit1.Text);
  if k <= 9 then
    broj := k
  else    
    broj := (k + 10) / 2;

  if k mod 2 = 0 then
    broj := broj / 10
  else
    broj := broj mod 10; // error line

  ShowMessage(FloatToStr(broj));    
end;
Run Code Online (Sandbox Code Playgroud)

delphi delphi-7

3
推荐指数
1
解决办法
274
查看次数

程序一直告诉我写的数字不是整数

我制作了一个程序,它不断告诉我输入的数字不是整数.

我正在进入100010110101,它弹出这个错误:

图片

码:

procedure TForm1.Button1Click(Sender: TObject);
var
  m,lo,cshl,cdhl,cjhl,csl,cdl,cjl:integer;
begin
  m := StrToInt(Edit1.Text);
  cshl := m div 100000000000;
  cdhl := m div 10000000000 mod 10;
  cjhl := m div 10000000000 mod 100;
  csl := m div 1000000000 mod 1000;
  cdl := m div 100000000 mod 10000;
  cjl := m div 10000000 mod 100000;
  lo := cjl + cdl * 10 + csl * 100 + cjhl * 1000 + cdhl * 10000 + cshl  *100000;
  ShowMessage(IntToStr(lo));
end;
Run Code Online (Sandbox Code Playgroud)

delphi delphi-7

1
推荐指数
1
解决办法
219
查看次数

找不到档案"Form2.dcu"

我无法解决这个问题,任何人都可以帮忙吗?

第1单元代码:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Form2; //error here

type
  TForm1 = class(TForm)
Run Code Online (Sandbox Code Playgroud)

这是第2单元

unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm2 = class(TForm)
    CESTITAMO: TLabel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Rezultat11: TLabel;
    REZULTAT21: TLabel;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

end.
Run Code Online (Sandbox Code Playgroud)

是的,我创建了Form2,它的标题是"Cestitke!" 并保持名称为Form2

我想知道将来如何修复它,谢谢

delphi delphi-7

-2
推荐指数
1
解决办法
197
查看次数

标签 统计

delphi ×3

delphi-7 ×3