加入一句{$R WindowsXP},控件具有系统主题风格。
implementation
{$R *.dfm}
{$R windowsXP}
{ TMyThread }
==============================
procedure TForm1.Button1Click(Sender: TObject);
const
{$I str.inc}
begin
showmessage(MSG);
end;
文件 str.inc
MSG = 'abc';
=============================
设置标题可以用[color=#FF0000]SetTextBuf('abc')或Text:='abc'[/color].
1
2
3
4
5
6
7
|
procedure
TForm1
.
FormCreate(Sender: TObject);
begin
SetTextBuf(
'abc'
);
ShowMessage(Text);
Text :=
'def'
;
ShowMessage(Caption)
end
;
|
新建一个普通工程,然后在工程源文件里,在program一句的下一行加上{$APPTYPE CONSOLE},这样就可以在程序中使用Write之类的语句在控制台输出调试信息了。
Project2;
{
$APPTYPE
CONSOLE}
uses
Forms,
Unit1
in
'Unit1.pas'
{Form1}
;
$R
*.res}
begin
Write
(
'start!'
);
Application
Initialize;
CreateForm(TForm1, Form1);
Run;
.
=============================================
procedure也可以有返回值:
Integer
);
asm
//eax存储a,edx存储b,相加的结果又保存到eax
add eax,edx
;
FormCreate(Sender: TObject);
type
TAdd=
function
(a,monospace!important; font-size:1em!important; padding:0px!important; margin:0px!important; border:0px!important; outline:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; line-height:1.1em!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; width:auto!important; min-height:inherit!important">):
;
var
P:
Pointer
;
I:
;
begin
P := @Add;
I := TAdd(P)(
1
,
2
);
ShowMessageFmt(
'%d'
Nowrap; list-style:none; font-family:Consolas, [I])
;