[fpc-pascal] cross platform version of IsCharAlpha()

ik idokan at gmail.com
Mon Jan 12 10:13:04 CET 2009


The problem with such function is that it requires a lot of data to be
used on a non ANSI table. and you can not use in a unicode
implementation the Char type, because a char can be more then one
byte.

Ido

On Mon, Jan 12, 2009 at 11:09 AM, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:
> Hi,
>
> 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;
> begin
>  // This is very primitive and doesn't take special chars or unicode into
>  // consideration.
>  if AChar in ['a'..'z', 'A'..'Z'] then
>    Result := True
>  else
>    Result := False;
> end;
>
>
> Anybody got a better Object Pascal version of IsCharAlpha() I can use
> and that we can add into Free Pascal?
>
>
> Regards,
>  - Graeme -
>
>
> _______________________________________________
> fpGUI - a cross-platform Free Pascal GUI toolkit
> http://opensoft.homeip.net/fpgui/
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



More information about the fpc-pascal mailing list