Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 572943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:40:19+00:00 2026-05-13T13:40:19+00:00

Here is another question about convert old code to D2009 and Unicode. I’m certain

  • 0

Here is another question about convert old code to D2009 and Unicode. I’m certain that there is simple but i don’t see the solution…
CharacterSet is a set of Char and s[i] should also be a Char.
But the compiler still think there is a conflict between AnsiChar and Char.

The code:

TSetOfChar = Set of Char;

procedure aFunc;
var
  CharacterSet: TSetOfChar;
  s: String;
  j: Integer;
  CaseSensitive: Boolean;
begin
  // Other code that assign a string to s
  // Set CaseSensitive to a value

  CharacterSet := [];
  for j := 1 to Length(s) do
  begin
    Include(CharacterSet, s[j]);  // E2010 Incompatible types: 'AnsiChar' and 'Char'
    if not CaseSensitive then
    begin
      Include(CharacterSet, AnsiUpperCase(s[j])[1]);
      Include(CharacterSet, AnsiLowerCase(s[j])[1])
    end
  end;
end;  
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:40:19+00:00Added an answer on May 13, 2026 at 1:40 pm

    There is no good and simple answer to the question (the reason is already given by Mason). The good solution is to reconsider the algoritm to get rid off “set of char” type. The quick and dirty solution is to preserve ansi chars and strings:

    TSetOfChar = Set of AnsiChar;
    
    procedure aFunc;
    var
      CharacterSet: TSetOfChar;
      s: String;
      S1, SU, SL: Ansistring;
      j: Integer;
      CaseSensitive: Boolean;
    begin
      // Other code that assign a string to s
      // Set CaseSensitive to a value
    
      S1:= s;
      SU:= AnsiUpperCase(s);
      SL:= AnsiLowerCase(s);
      CharacterSet := [];
      for j := 1 to Length(S1) do
      begin
        Include(CharacterSet, S1[j]);
        if not CaseSensitive then
        begin
          Include(CharacterSet, SU[j]);
          Include(CharacterSet, SL[j]);
        end
      end;
    end;  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 299k
  • Answers 299k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer C++ Class definitions do not assign memory. class is like… May 13, 2026 at 7:43 pm
  • Editorial Team
    Editorial Team added an answer While adding a return false; will fix your problem (as… May 13, 2026 at 7:43 pm
  • Editorial Team
    Editorial Team added an answer Update: I just found: http://code.google.com/p/minidetector/ Which seems to do exactly… May 13, 2026 at 7:43 pm

Related Questions

FYI - I am a mainframer that moved to the .NET world a couple
I have a task at work that involves converting legacy SGM files into XML.
I was going to ask a question here about whether or not my design
I have this legacy code base (Compaq PERL) , about 1500 lines of code,
I have edited this question to make it easier to understand. I have an

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.