Delphi 试试带参数的 Exit


本文整理自网络,侵删。

 
试试带参数的 Exit
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function fun(str: string): string;
begin
  if str = '' then Exit('空'); {Delphi 2009 支持}
  Result := str + str;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  s: string;
begin
  s := fun('ABC');
  ShowMessage(s);  {ABCABC}

  s := fun('');
  ShowMessage(s);  {空}
end;

end.

相关阅读 >>

Delphi 封装的tidhttp get post 请求

Delphi searchbox1 基本用法

Delphi远程线程注入获取qq密码

Delphi让程序运行后自我删除或恢复名称

Delphi idhttp 断开连接/超时读取

Delphi用twebbrowser组件在Delphi中post数据和取得网页源文件

Delphi adoconnection1 连接excel表格读取数据

Delphi 线程同步(线程安全)

Delphi searchrec.attr and fadirectory

Delphi 十进制十六进制转换

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...