Delphi调用WinAPI 字符及字符串函数(5): IsCharAlpha

unit Unit1;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, StdCtrls;
type
 TForm1 = class(TForm)
  Button1: TButton;
  Button2: TButton;
  Button3: TButton;
  Button4: TButton;
  Button5: TButton;
  procedure Button1Click(Sender: TObject);
  procedure Button2Click(Sender: TObject);
  procedure Button3Click(Sender: TObject);
  procedure Button4Click(Sender: TObject);
  procedure Button5Click(Sender: TObject);
 end;
var
 Form1: TForm1;
implementation
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

var
 c: Char;
 b: BOOL;
begin
 c := #65; {A}
 b := IsCharAlpha(c);
 ShowMessage(BoolToStr(b, True)); {True}
end;

procedure TForm1.Button2Click(Sender: TObject);

var
 c: Char;
 b: BOOL;
begin
 c := #97; {a}
 b := IsCharAlpha(c);
 ShowMessage(BoolToStr(b, True)); {True}
end;

procedure TForm1.Button3Click(Sender: TObject);

var
 c: Char;
 b: BOOL;
begin
 c := #48; {0}
 b := IsCharAlpha(c);
 ShowMessage(BoolToStr(b, True)); {False}
end;

procedure TForm1.Button4Click(Sender: TObject);

var
 c: Char;
 b: BOOL;
begin
 c := #13; {回车键}
 b := IsCharAlpha(c);
 ShowMessage(BoolToStr(b, True)); {False}
end;

procedure TForm1.Button5Click(Sender: TObject);

var
 c: WideChar;
 b: BOOL;
begin
 c := #19975; {万}
 b := IsCharAlpha(c);
 ShowMessage(BoolToStr(b, True)); {False}
end;

时间: 2024-11-05 14:42:03

Delphi调用WinAPI 字符及字符串函数(5): IsCharAlpha的相关文章

Delphi调用WinAPI 字符及字符串函数(1)

CharLower - 字符或字符串转小写 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; Button5:

Delphi调用WinAPI 字符及字符串函数(3)

CharUpper - 字符或字符串转大写 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; Button5:

Delphi调用WinAPI 字符及字符串函数(14): CharToOem、OemToChar

CharToOemBuff.OemToCharBuff 与 CharToOem.OemToChar 的区别只是前者可以指 定要转换的字符数.unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButt

Delphi调用WinAPI 字符及字符串函数(11)

lstrcpyn - 复制字符串, 同时指定要复制的长度 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

Delphi调用WinAPI 字符及字符串函数(10)

lstrcpy - 复制字符串 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; procedure Button1Click(Sender: T

Delphi调用WinAPI 字符及字符串函数(9)

lstrcat - 合并字符串 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; procedure Butt

Delphi调用WinAPI 字符及字符串函数(4)

CharLowerBuff - 把缓冲区中指定数目的字符转大写 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton

Delphi调用WinAPI 字符及字符串函数(13)

lstrcmp.lstrcmpi - 对比串 lstrcmp 区分大小写; lstrcmpi 不区分大小写. 返回值: -1.0.1, 其中 0 表示相 同. unit Unit1;interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Butto

Delphi调用WinAPI 字符及字符串函数(12): lstrlen

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Se