Hello
The HTTPCLI object uses a memorystream, but I need to turn this into
a string so that I can pass the web page to a TPerlRegEx object to
extract some information.
I'm a newbie, and can't find why Delphi2007 complains about incompatible type:
=========
function StreamToText(oStream : TMemoryStream ): String;
var
oSL : TStringlist;
begin
oSL := TStringlist.Create;
oSL.LoadFromStream(oStream);
result := oSL.Text;
oSL.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
WebPage : String;
begin
With HttpCli1 do begin
URL := 'www.acme.com';
RcvdStream := TMemoryStream.Create;
try
Get;
except
ShowMessage('Oops');
RcvdStream.Free;
Exit;
end;
RcvdStream.Seek(0,0);
//Memo1.Lines.LoadFromStream(RcvdStream);
//E2010 Incompatible types: 'TMemoryStream' and 'TStream'
WebPage := StreamToText(RcvdStream);
RcvdStream.Free;
end;
=========
Any idea what is wrong?
Thank you for any tip.
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be