unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TShared = record
Keys:array [0..5] of String;
end;
PShared = ^TShared;
var
Form1: TForm1;
Shared: PShared;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
Shared^.Keys[0]:='windows xp';
Shared^.Keys[1]:='windows 2000';
Shared^.Keys[2]:='windows 7';
Shared^.Keys[3]:='windows 98';
Shared^.Keys[4]:='windows 2003';
Shared^.Keys[5]:='windows server 10';
end;end.click提示出错,但编译通过,错在哪?
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TShared = record
Keys:array [0..5] of String;
end;
PShared = ^TShared;
var
Form1: TForm1;
Shared: PShared;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
Shared^.Keys[0]:='windows xp';
Shared^.Keys[1]:='windows 2000';
Shared^.Keys[2]:='windows 7';
Shared^.Keys[3]:='windows 98';
Shared^.Keys[4]:='windows 2003';
Shared^.Keys[5]:='windows server 10';
end;end.click提示出错,但编译通过,错在哪?
解决方案 »
- delphi xe2 是如何创建动态链接库的 *.dll
- 小弟初学DELPHI 就遇到大问题 哪位高手 给点指导!!!!
- ***请问'=:'这个符号是什么意思**********
- 怎么把dbtreelist中选中的多条记录,插入选中的dbtreeview节点下面。
- 请问ksthemeforms是哪一个控件包中的。谢谢各位好心人
- Delphi连接Access数据库如何判断字段为自增性
- 菜鸟求教:使用adoquery的SQL查询语句(//bow)
- adoquery如何在程序中add fields?
- 有誰知道中国的IP地址范围,在线等待
- DBGrid如何增加一行数据?
- 问一个指针的释放的问题
- PE的引入模块~~
前面用new(Shared),后面记得释放
begin
new(Shared);
end;procedure TForm1.FormDestroy(Sender: TObject);
begin
dispose(Shared);
end;
dispose(shared)
procedure TForm1.Button1Click(Sender: TObject);
begin
New(Shared);
Shared^.Keys[0]:='windows xp';
Shared^.Keys[1]:='windows 2000';
Shared^.Keys[2]:='windows 7';
Shared^.Keys[3]:='windows 98';
Shared^.Keys[4]:='windows 2003';
Shared^.Keys[5]:='windows server 10';
Dispose(Shared);
end;