Ok, I don't think I explained this very well. In php I can have a
function that uses echo(response.write) to send data to the browser.
However, I can tell php to buffer it and not send it to the browser.
Then I can grab the data that is in the buffer and put it in a
variable. In my example below the line in myFunc, echo "soemthing
else"; never gets sent to the browser and I put the contents of the
buffer in the variable $out. Basically, I have some asp code with a
very big function. I want to take all the data sent with
Response.Write and the plain html and capture it before it is sent to
the browser. I know that I can do something like
sub mySub
content = content & "some html here
....
end sub
I don't want to do this because the sub is thousands of lines of code
and I don't want to change it all. In asp you can do something like
Response.buffer = true and it will put all the output in a buffer and
send it all at once rather than piecemeal. I want to be able to get at
the data in the buffer before it is sent and stop it from beind sent.
ja********@gmail.com (Jay Donnell) wrote in message news:<9c*************************@posting.google.c om>...
I have a function that is a few thousand lines of code (I didn't write
it) and I want to capture the output and save it as a variable. This
is very easy to do in php. It would look something like this.
<?php
function myFunc(){
echo "something else"
}
//sent immediately to browser
echo "something"
//start capturing the output
ob_start();
myFunc()
$out = ob_get_clean();
//$out now contains 'something else'
//and 'something else' is never sent to the browser.
?>
Is this possible in ASP? I've searched the net and haven't been able
to find anything.