"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:OM**************@TK2MSFTNGP12.phx.gbl...
I didn't fully follow your explanation here, but try declaring your
variables in a narrower scope in your classes. Don't just dim everything
out in the open. Encapsulate logic into subroutines and functions, and
use local variables within them.
Thanks Ray, but I'm already doing that.
Just to be a bit more specific about the problem, the "duplicate name"
errors refer to the Class names.
Consider this scenario ...
One record layout describes a Company. The Company record has a column
(Property) called Name among other things.
Another record layout describes a Person. The Person record has columns
(Properties) called FName, MName, and LName.
All 4 name fields are of a Class clName.
The Class library looks something like:
Class clCompany
(uses clName for 1 property)
Class clPerson
(uses clName for 3 properties)
In the ASP using the Company and Person Class'es I am forced to do something
like:
(Main ASP file)
<#include file="clName.asp">
<#include file="clCompany.asp">
<#include file="clPerson.asp">
What I would rather do is pull the column #include out of the main ASP and
instead place it in the Class'es that require it. That would leave me with
something like this:
(Main ASP file)
<#include file="clCompany.asp">
<#include file="clPerson.asp">
(clCompany Class file)
<#include file="clName.asp">
(clPerson Class file)
<#include file="clName.asp">
But that will cause a VBScript error because the Class name in "clName.asp"
is redefined (duplicated).
Is there a way to gracefully get around this?