Re: Redefined variable by jeff
jeff
Sun Jul 18 18:41:10 CDT 2004
On Sun, 18 Jul 2004 14:19:29 -0300, Serge Myrand
<info@softdelirium.qc.ca> wrote:
>Because this is a menu bar and there is an option taht allow the user to put
>it at the bottom and at the top of the page.
So? Do this:
[Menubar.asp]
<%
Sub Menubar
Dim Menubar1, Menubar2
...Menubar code...
End Sub
%>
[Page.asp]
<!--#include virtual="menubar.asp"-->
<%
Menubar
Response.Write "Page text and stuff..."
Menubar
%>
Learn to use subs and functions.
Jeff
>serge
>
>Jeff Cochran wrote:
>
>> On Sun, 18 Jul 2004 10:19:51 -0300, Serge Myrand
>> <info@softdelirium.qc.ca> wrote:
>>
>> >In an ASP page, I need to load twice an include file that contains
>> >variables. So I get an error message "variable redefine" I tried to test
>>
>> Why would you need to include a file twice? If it has different
>> values for the variables, name them differently and include them once.
>>
>> >with VarType before to define the variable (dim) with no success. Is it
>> >faisable with VBScript to define a variable (dim) under condition.
>>
>> No.
>>
>> >' this code gives an error
>> >if VarType("MyVar") = vbNull then
>> > dim MyVar
>> >end if
>>
>> Hmm... Using a variable before defining it, why would that cause an
>> error?
>>
>> You can REDIM if needed, but rethink your code and do it correctly the
>> first time.
>>
>> Jeff