Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use TCharHelper?

The next code:

function get_symbol (var s: String): String;
var c: Char;
    p: Int32;
begin
// ... some more code ...
   c := upcase (s [p]);
   if IsDigit (c) then

causes the following error message:

[dcc32 Warning] fmx_utilities_string.pas(188): W1000 Symbol 'IsDigit' is deprecated: 'Use TCharHelper'

I don't understand this message as System.Character is included, c is declared to be Char and TCharhelper is declared as a character helper of Char. What am I doing wrong?

like image 467
Arnold Avatar asked Jan 07 '15 13:01

Arnold


1 Answers

You're not using TCharHelper; you're using the old System.Character IsDigit function instead. The way to use TCharHelper.IsDigit is:

if c.IsDigit then
  ...
like image 94
Ken White Avatar answered Oct 16 '22 08:10

Ken White