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 获取cpu使用单元文件

Delphi winexec 执行cmd

Delphi发送邮件

Delphi 提取字符串左侧内容

Delphi webbrowser载入自定义html内容并显示

Delphi中exit,abort,break,continue的区别介绍

Delphi获取宽带ip

Delphi 检查用户输入必须是汉字串

Delphi中引用sqlite3

Delphi 如何将整数值转换为罗马数字表示形式

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



打赏

取消

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

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

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

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

评论

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

    正在狠努力加载,请稍候...