BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pointer to string

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
stbecker
Guest





PostPosted: Wed Nov 03, 2004 10:52 pm    Post subject: pointer to string Reply with quote



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





PostPosted: Wed Dec 15, 2004 2:32 am    Post subject: Re: pointer to string Reply with quote



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





PostPosted: Wed Dec 15, 2004 2:32 am    Post subject: Re: pointer to string Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.