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

  • SEARCH
  • Home
  • 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 5846681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:36:40+00:00 2026-05-22T12:36:40+00:00

Under Delphi XE, is there an ANSI version for Copy? I am using Copy

  • 0

Under Delphi XE, is there an ANSI version for Copy?
I am using Copy a lot to copy pieces of a ANSI strings.

  • 1 1 Answer
  • 0 Views
  • 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-22T12:36:40+00:00Added an answer on May 22, 2026 at 12:36 pm

    Altar the Copy function in Delphi is a intrinsic function this means which is handled by the compiler rather than the run-time library. depending of the parameters passed this function call the LStrCopy or a UStrCopy internal functions

    check this sample :

    {$APPTYPE CONSOLE}
    
    uses
      SysUtils;
    Var
       s : AnsiString;
       u : string;
    begin
      try
       s:='this is a ansi string';
       s:= Copy(s,1,5);
       Writeln(s);
       u:='this is a unicode string';
       u:= Copy(u,1,5);
       Writeln(u);
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
      Readln;
    end.
    

    Now check the assembly code

    Project91.dpr.12: s:='this is a ansi string';
    004111DC B8787E4100       mov eax,$00417e78
    004111E1 BA04134100       mov edx,$00411304
    004111E6 E8314FFFFF       call @LStrAsg
    Project91.dpr.13: s:= Copy(s,1,5);
    004111EB 68787E4100       push $00417e78
    004111F0 B905000000       mov ecx,$00000005
    004111F5 BA01000000       mov edx,$00000001
    004111FA A1787E4100       mov eax,[$00417e78]
    004111FF E8A050FFFF       call @LStrCopy //call the ansi version of copy
    Project91.dpr.14: Writeln(s);
    00411204 A1EC2C4100       mov eax,[$00412cec]
    00411209 8B15787E4100     mov edx,[$00417e78]
    0041120F E84033FFFF       call @Write0LString
    00411214 E8DF33FFFF       call @WriteLn
    00411219 E8D22AFFFF       call @_IOTest
    Project91.dpr.15: u:='this is a unicode string';
    0041121E B87C7E4100       mov eax,$00417e7c
    00411223 BA28134100       mov edx,$00411328
    00411228 E8534EFFFF       call @UStrAsg
    Project91.dpr.16: u:= Copy(u,1,5);
    0041122D 687C7E4100       push $00417e7c
    00411232 B905000000       mov ecx,$00000005
    00411237 BA01000000       mov edx,$00000001
    0041123C A17C7E4100       mov eax,[$00417e7c]
    00411241 E8C654FFFF       call @UStrCopy //call the unicode version of copy
    Project91.dpr.17: Writeln(u);
    00411246 A1EC2C4100       mov eax,[$00412cec]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using SerialPort under Delphi Prism. I am able to send bytes out
When I compile my application under Delphi 2006 I get the following warning [Pascal
Under Windows XP WPF true 3D content (which is usually displayed using the Viewport3D
Under VS's external tools settings there is a Use Output Window check box that
Under Linux, my C++ application is using fork() and execv() to launch multiple instances
I am using Delphi 2007 with all patches and updates. I have a file
How can I detect if my application is running under the IDE Delphi 2007
I have a Delphi 2010 app which shows/hides the desktop icons under XP fine.
I have an IFilter written in Delphi that I'm trying to get working under
HI I'm using Delphi 2007 and have set the MainFormOnTaskBar property to true. The

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.