关于变量定义的疑问

alessandro 2003-08-07 04:53:33
我再delphi的单元unit1中这样定义了变量
var
Form1: TForm1;
type TArrays=array[0..200] of integer;
BubbleSortArrays: TArrays;
却总是出现[Error] Unit1.pas(29): '=' expected but ':' found的错误,但是当我定义如下时错误就没有了。
var
Form1: TForm1;
type TArrays=array[0..200] of integer;
var
BubbleSortArrays: TArrays;
不知道原因在哪里,特来请教一下各位。
...全文
39 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
李_军 2003-08-07
  • 打赏
  • 举报
回复
type TArrays=array[0..200] of integer;
var
BubbleSortArrays: TArrays;
DWGZ 2003-08-07
  • 打赏
  • 举报
回复
不好意思多了个 type 都是copy惹的祸
DWGZ 2003-08-07
  • 打赏
  • 举报
回复
type TArrays=array[0..200] of integer;
var
BubbleSortArrays: TArrays;

你的类型声明最好放在一起怎么左放一个右放一个

type
type TArrays=array[0..200] of integer;

TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

BubbleSortArrays: TArrays;
DWGZ 2003-08-07
  • 打赏
  • 举报
回复
type TArrays=array[0..200] of integer;
var
BubbleSortArrays: TArrays;

你的类型声明最好放在一起怎么左放一个右放一个

type
type TArrays=array[0..200] of integer;

TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

BubbleSortArrays: TArrays;
elilor 2003-08-07
  • 打赏
  • 举报
回复
[Error] Unit1.pas(29)出错的是BubbleSortArrays: TArrays;这一行吧
因为你前面是以type开始的,它以为BubbleSortArrays也是在定义类型呢
加上var它就知道你是在定义变量了

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧