I'm just wondering if there is a possibility to un-dim a variable.
Imagine this is my #include file that I'm using in ASP page
Dim MyVar
MyVar = "Hello World"
Response.write(MyVar)
'From now on I can not use Dim MyVar anymore as it throws an error
'I have tried
MyVar = Nothing
Set MyVar = Nothing
'But again, when you do
Dim MyVar
'It throws an error.
The reason for this is that I cannot use the same #INCLUDE file more than once per page. And yes, I do like using Option Explicit as it helps me to keep my code cleaner.
*) Edited: I see that it's not as clear as I wanted.
Imagine this is a "include.asp"
<%
Dim A
A=1
Response.Cookie("beer")=A
%>
Now the asp page:
<!--#include file="include.asp"-->
<%
'Now: I do not see whats in include above and I want to use variable A
Dim A
'And I get an error
'I also cannot use the same include again:
%>
<!--#include file="include.asp"-->
Do you see my point? If I would be able to UNDIM the A variable at the end of the Include, the problem would be solved.