I created a class in asp and wanted to know if it was possible to create a function or sub named "END". Is this possible even as a sub or function. The reason I wanted to call this for my class instance or class module like MyClass.End is to then call response.end?
Or is it possible to overide the response.end function to first check something before ending?
class Myclass
sub write(dim str)
response.write(str)
end write
' Is this "END" possible?
sub end
response.end
end sub
End class
Correction
This is not a valid subroutine declare :
sub write(dim str)
Dim statement cannot be used to declare parameters. You should use ByRef or ByVal. Default is ByRef if not specified.
And
end write
should beend sub
.See instructions from MSDN : Sub Statement
Trick
When you need to use a reserved keyword for property or method name in the classes, you can declare it with brackets. Then you can call without brackets. Here the example:
end
is a reserved word for vbscript (what classic ASP is based on) so no. This is a list of reserved words... http://support.microsoft.com/kb/216528