aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UCommon.pas
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UCommon.pas41
1 files changed, 11 insertions, 30 deletions
diff --git a/Game/Code/Classes/UCommon.pas b/Game/Code/Classes/UCommon.pas
index 4465a397..fe3ea6a4 100644
--- a/Game/Code/Classes/UCommon.pas
+++ b/Game/Code/Classes/UCommon.pas
@@ -660,27 +660,19 @@ end;
function IsAlphaChar(ch: WideChar): boolean;
begin
// TODO: add chars > 255 when unicode-fonts work?
- case ch of
- 'A'..'Z', // A-Z
- 'a'..'z', // a-z
- #170,#181,#186,
- #192..#214,
- #216..#246,
- #248..#255:
- Result := true;
- else
- Result := false;
- end;
+ Result := ch in
+ ['A'..'Z', // A-Z
+ 'a'..'z', // a-z
+ #170, #181, #186,
+ #192..#214,
+ #216..#246,
+ #248..#255
+ ];
end;
function IsNumericChar(ch: WideChar): boolean;
begin
- case ch of
- '0'..'9':
- Result := true;
- else
- Result := false;
- end;
+ Result := ch in ['0'..'9'];
end;
function IsAlphaNumericChar(ch: WideChar): boolean;
@@ -691,23 +683,12 @@ end;
function IsPunctuationChar(ch: WideChar): boolean;
begin
// TODO: add chars outside of Latin1 basic (0..127)?
- case ch of
- ' '..'/',':'..'@','['..'`','{'..'~':
- Result := true;
- else
- Result := false;
- end;
+ Result := ch in [ ' '..'/', ':'..'@', '['..'`', '{'..'~' ];
end;
function IsControlChar(ch: WideChar): boolean;
begin
- case ch of
- #0..#31,
- #127..#159:
- Result := true;
- else
- Result := false;
- end;
+ Result := ch in [ #0..#31, #127..#159 ];
end;
(*