Consider the following ASP code snippet:
<%
Dim strFYear,strLYear,iFYear,iLYear
strFYear="1/4/2001" '(d/m/yyyy)
strFYear="31/3/2001" '(d/m/yyyy)
iFYear=Year(strFYear)
iLYear=Year(strLYear)
%>
Now if I do something like this (note that I am not doing a Response.Write):
<% Year(strFYear) %>-<% Year(strLYear) %>
there is no problem & as expected, only the dash (-) can be seen in the browser. But now if I change the above to something like this (again no Response.Write):
<% iFYear %>-<% iLYear %>
an error is thrown saying Type mismatch 'iFYear'. Why so?
Thanks,
Arpan
<%
Dim strFYear,strLYear,iFYear,iLYear
strFYear="1/4/2001" '(d/m/yyyy)
strFYear="31/3/2001" '(d/m/yyyy)
iFYear=Year(strFYear)
iLYear=Year(strLYear)
%>
Now if I do something like this (note that I am not doing a Response.Write):
<% Year(strFYear) %>-<% Year(strLYear) %>
there is no problem & as expected, only the dash (-) can be seen in the browser. But now if I change the above to something like this (again no Response.Write):
<% iFYear %>-<% iLYear %>
an error is thrown saying Type mismatch 'iFYear'. Why so?
Thanks,
Arpan