Recent

Author Topic: [Solved] Illegal qualifier when use TStringHelper.StartsWith()  (Read 403 times)

artem101

  • Full Member
  • ***
  • Posts: 114
[Solved] Illegal qualifier when use TStringHelper.StartsWith()
« on: December 01, 2025, 10:22:33 am »
What is wrong here?

Code: Pascal  [Select][+][-]
  1. {$Mode objfpc}    
  2.  
  3. program Hello;
  4. uses sysutils,Classes;
  5. var
  6. s: string;
  7. begin
  8.   s:='hello';
  9.   writeln(s.startswith('h'));
  10. end.

Quote
main.pas(9,13) Error: Illegal qualifier
« Last Edit: December 01, 2025, 11:14:33 am by artem101 »

Zvoni

  • Hero Member
  • *****
  • Posts: 3270
Re: Illegal qualifier when use TStringHelper.StartsWith()
« Reply #1 on: December 01, 2025, 10:36:05 am »
Code: Pascal  [Select][+][-]
  1. {$Mode objfpc}
  2. {$H+}  //<-- !!!!!
  3. program Hello;
  4. uses Classes,sysutils;
  5. var
  6. s: string;
  7. b: Boolean;
  8. begin
  9.   s:='hello';
  10.   writeln(s.startswith('h'));
  11.   Readln;
  12. end.
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

artem101

  • Full Member
  • ***
  • Posts: 114
Re: Illegal qualifier when use TStringHelper.StartsWith()
« Reply #2 on: December 01, 2025, 11:14:10 am »
Thanks!

 

TinyPortal © 2005-2018