delphi编译的时候出现警告

delphi编译的时候出现警告,第1张

警告的意思是建议你使用CharInSet这个函数

在Delphi里,警告并不会导致编译失败,只是提示你这样代码存在

不安全因素

只要自己能掌握不安全因素,用try来处理不安全因素引发的问题,这样程序就不会完全崩溃了。

unit Unit1interfaceuses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ExtCtrlstype

TForm1 = class(TForm)

Timer1: TTimer

Label1: TLabel

Label2: TLabel

procedure Timer1Timer(Sender: TObject)

private

{ Private declarations }

public

{ Public declarations }

endvar

Form1: TForm1implementation{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject)

var s :string

begin

Label1.Caption := FormatDateTime('yyyy/mm/dd AM/PM hh:mm ', Now + 0.125)

Label2.Caption := FormatDateTime('hhmmss',now())

if(FormatDateTime('hhmmss',now())='000000') then

showmessage(FormatDateTime('yyyy/mm/dd AM/PM hh:mm ', Now + 0.125))

endend.


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/12084736.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-20
下一篇 2023-05-20

发表评论

登录后才能评论

评论列表(0条)

保存