[fpc-pascal] cross platform version of IsCharAlpha()
florian at freepascal.org
Mon Jan 12 11:49:29 CET 2009
Graeme Geldenhuys schrieb:
> IsCharAlpha() is a Win32 API call. I'm trying to convert code that
> uses that call, to be Windows and Linux compatible. Does FPC have a
> cross-platform version of that API call? I did a text search through
> the RTL of v2.2.3 and it only seems to have the Windows API version.
> I can add a Linux specific function like this in my code, but as the
> comment says, it is very primitive and clearly not ideal!
> function IsCharAlpha(AChar: Char): Boolean;
> // This is very primitive and doesn't take special chars or unicode into
> // consideration.
> if AChar in ['a'..'z', 'A'..'Z'] then
> Result := True
> Result := False;
> Anybody got a better Object Pascal version of IsCharAlpha() I can use
> and that we can add into Free Pascal?
Add a new entry to the widestring manager, add a implementation to
sysutils using the widestring manager. Implement it in the cwstrings for
unix and sysutils directly for windows, for unix you can use iswalpha:
Create a test and submit a patch :)
More information about the fpc-pascal