 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
stbecker Guest
|
Posted: Wed Nov 03, 2004 10:52 pm Post subject: pointer to string |
|
|
I'm a little new at this, how do I convert a pointer to a string?In the following example, Buffer may contain a null characterso the Len variable is required to show the length. UsingStrPas will interpret the first null character as the end ofline, so how can I do this?
procedure This(Buffer: Pointer; var Len: Integer);
var
mystr: string;
begin
mystr:=strpas(buffer);
end;
User submitted from AEWNET (http://www.aewnet.com/)
|
|
| Back to top |
|
 |
Jianwei Sun Guest
|
Posted: Wed Dec 15, 2004 2:32 am Post subject: Re: pointer to string |
|
|
You can try:
procedure This(Buffer: Pointer; var Len: Integer);
var
mystr: string;
begin
SetLength(mystr, Len);
Move(Buffer^, mystr[1], Len);
end;
"stbecker" <stbecker (AT) aew_nospam (DOT) com> ????
news:41896f52 (AT) newsgroups (DOT) borland.com...
I'm a little new at this, how do I convert a pointer to a string? In the
following example, Buffer may contain a null character so the Len variable
is required to show the length. Using StrPas will interpret the first null
character as the end of line, so how can I do this?
procedure This(Buffer: Pointer; var Len: Integer);
var
mystr: string;
begin
mystr:=strpas(buffer);
end;
User submitted from AEWNET (http://www.aewnet.com/)
|
|
| Back to top |
|
 |
Jianwei Sun Guest
|
Posted: Wed Dec 15, 2004 2:32 am Post subject: Re: pointer to string |
|
|
You can try:
procedure This(Buffer: Pointer; var Len: Integer);
var
mystr: string;
begin
SetLength(mystr, Len);
Move(Buffer^, mystr[1], Len);
end;
"stbecker" <stbecker (AT) aew_nospam (DOT) com> ????
news:41896f52 (AT) newsgroups (DOT) borland.com...
I'm a little new at this, how do I convert a pointer to a string? In the
following example, Buffer may contain a null character so the Len variable
is required to show the length. Using StrPas will interpret the first null
character as the end of line, so how can I do this?
procedure This(Buffer: Pointer; var Len: Integer);
var
mystr: string;
begin
mystr:=strpas(buffer);
end;
User submitted from AEWNET (http://www.aewnet.com/)
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|