[fpc-devel] MoveChars - docs.embarcadero.com ...
silvioprog
silvioprog at gmail.com
Sun Jul 22 20:18:15 CEST 2012
2012/7/22, Jonas Maebe <jonas.maebe at elis.ugent.be>:
>
> On 22 Jul 2012, at 04:54, silvioprog wrote:
>
>> There MoveChars* function (or similar) native on Free Pascal?
>>
>> (*) -
>> http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/System_MoveChars.html
>
> As far as I can tell,
>
> MoveChars(Source,Dest,Length);
>
> is exactly the same as
>
> Move(Source,Dest,Length*2);
>
>
> Jonas
Hm... I think that MoveChars copy a string to another string, but
maintaining the contents of the second string (I'm without delphi for
test it).
So, I'll try to explain my problem ...
I am needing to move a string to another string, eg:
var
d, s: string;
begin
d := 'the on the table';
s := 'books ';
SetLength(d, Length(d) + Length(s));
Move(s, d[4], Length(s));
writeln(d); // the result should be 'the books on the table', but I
get 'the|?S |?e table ?'
end;
I could easily do this using "copy", but I'm trying (without success)
to do this at low level.
Thank you Jonas! :)
--
Silvio Clécio
My public projects - github.com/silvioprog
More information about the fpc-devel
mailing list