This line:
set Response = nothing
Fails with the error
"Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Response' "
Now, I can think of any number of reasons why the engine might not want to let me do such a seemingly silly thing, but I'm not sure how a missing method could be stopping me.
EDIT: Here is an example of what I'd like to do with this.
class ResponseBufferEphemeron
private real_response_
private buffer_
private sub class_initialize
set real_response_ = Response
end sub
private sub class_terminate
set Response = real_response_
end sub
public function init (buf)
set buffer_ = buf
set init = me
end function
public function write (str)
buffer_.add str
end function
end class
function output_to (buf)
set output_to = (new ResponseBufferEphemeron).init(buf)
end function
dim buf: set buf = Str("Block output: ") ' My string class '
with output_to(buf)
Response.Write "Hello, World!"
end with
Response.Write buf ' => Block output: Hello, World! '