473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Server-side includes (IIS 5, classic VBScript)

I am building up a library of Class'es that represent various columns of
table layouts. One often used column is "name" and each occurrence is
treated identically. (What a concept, eh?)

Part of that library of Class'es includes representations of various tables.
(Just let me know if you see a trend going on here.) These Class'es use the
column Class'es.

What I would like to do, but I have yet to find a way around duplicated
names, is to place all the necessary supporting column Class #include's in
the table's Class so that I need only place the table's Class in the module
utilizing them.

I understand entirely why the "duplicate name" error occurs.

What I am looking for is a way around the conundrum that does not require
duplication of code. Any ideas?
Oct 25 '05 #1
7 2337
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.

Ray at work

"MyndPhlyp" <no****@homeright.now> wrote in message
news:ud**************@TK2MSFTNGP10.phx.gbl...
I am building up a library of Class'es that represent various columns of
table layouts. One often used column is "name" and each occurrence is
treated identically. (What a concept, eh?)

Part of that library of Class'es includes representations of various
tables.
(Just let me know if you see a trend going on here.) These Class'es use
the
column Class'es.

What I would like to do, but I have yet to find a way around duplicated
names, is to place all the necessary supporting column Class #include's in
the table's Class so that I need only place the table's Class in the
module
utilizing them.

I understand entirely why the "duplicate name" error occurs.

What I am looking for is a way around the conundrum that does not require
duplication of code. Any ideas?

Oct 25 '05 #2

"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?
Oct 25 '05 #3
AFAIK no as includes are processed even before ASP gets in play. I would
just keep the first design.

More specifically my personal preference in ASP was to do something like :
- to have my main file (ASP page)
- this main file includes a "coordination file"
- this "coordination file" includes in turns all other needed files
- eventually I could create another "coordination file" to include less
files if the number is growing and I really use much less than included

Finally it could give something like :
include virtual="/include/all.asp" in my main file

<#include file="clName.asp">
<#include file="clCompany.asp">
<#include file="clPerson.asp">
in "all.asp" for a start...

--
Patrice

"MyndPhlyp" <no****@homeright.now> a écrit dans le message de
news:uY*************@TK2MSFTNGP15.phx.gbl...

"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?

Oct 25 '05 #4

"Patrice" <no****@nowhere.com> wrote in message
news:ez**************@TK2MSFTNGP12.phx.gbl...
AFAIK no as includes are processed even before ASP gets in play. I would
just keep the first design.

More specifically my personal preference in ASP was to do something like :
- to have my main file (ASP page)
- this main file includes a "coordination file"
- this "coordination file" includes in turns all other needed files
- eventually I could create another "coordination file" to include less
files if the number is growing and I really use much less than included

Finally it could give something like :
include virtual="/include/all.asp" in my main file

<#include file="clName.asp">
<#include file="clCompany.asp">
<#include file="clPerson.asp">
in "all.asp" for a start...


I started going down that path - including all the classes in a common ASP
and then including the common ASP into the true ASP - but started
considering the amount of overhead involved in loading up all the extraneous
code.

Google'ing around, this subject seems to be an unresolved problem with
respect to classes and I may have to continue down the original path of
including all the record layout and column definition Class'es in each ASP.

If I could define a Class within a Class it would solve the problem because
I could "temporarily" escape out of the record's Class (%>) to fire off the
#include for the column's generic Class and then unescape back into the
script (<%). That would allow the column Class'es to be unique to the
record's Class.

I guess I am just pushing the envelope a tad bit too far.
Oct 25 '05 #5
Yes includes lacks for example some preprocessing capabilities.

I would just create here an alternate to the "all" file that includes only a
subset of the modules hat is enough for several pages. Also try perhaps to
see if this really causes a problem to see if it's worth...

Another approach could be perhaps to keep a single list (ie. you include all
you need in each page from a "model" list with dependencies comments) and
you just "comment" the parts you don't need...

Solved in ASP.NET ;-)
--
Patrice

"MyndPhlyp" <no****@homeright.now> a écrit dans le message de
news:%2****************@TK2MSFTNGP10.phx.gbl...

"Patrice" <no****@nowhere.com> wrote in message
news:ez**************@TK2MSFTNGP12.phx.gbl...
AFAIK no as includes are processed even before ASP gets in play. I would
just keep the first design.

More specifically my personal preference in ASP was to do something like : - to have my main file (ASP page)
- this main file includes a "coordination file"
- this "coordination file" includes in turns all other needed files
- eventually I could create another "coordination file" to include less
files if the number is growing and I really use much less than included

Finally it could give something like :
include virtual="/include/all.asp" in my main file

<#include file="clName.asp">
<#include file="clCompany.asp">
<#include file="clPerson.asp">
in "all.asp" for a start...
I started going down that path - including all the classes in a common ASP
and then including the common ASP into the true ASP - but started
considering the amount of overhead involved in loading up all the

extraneous code.

Google'ing around, this subject seems to be an unresolved problem with
respect to classes and I may have to continue down the original path of
including all the record layout and column definition Class'es in each ASP.
If I could define a Class within a Class it would solve the problem because I could "temporarily" escape out of the record's Class (%>) to fire off the #include for the column's generic Class and then unescape back into the
script (<%). That would allow the column Class'es to be unique to the
record's Class.

I guess I am just pushing the envelope a tad bit too far.

Oct 26 '05 #6

"Patrice" <no****@nowhere.com> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
Yes includes lacks for example some preprocessing capabilities.

I would just create here an alternate to the "all" file that includes only a subset of the modules hat is enough for several pages. Also try perhaps to
see if this really causes a problem to see if it's worth...

Another approach could be perhaps to keep a single list (ie. you include all you need in each page from a "model" list with dependencies comments) and
you just "comment" the parts you don't need...

Solved in ASP.NET ;-)


Ah, but the rules say we must play the cards we were dealt. ASP.NET violates
the rules in this rather warped game. I have already resigned myself to
listing all the needed Class'es in each main ASP and documented the required
#include's at the beginning of each record layout Class. It simplifies thing
just a bit but still lacks grace.

Another nice approach, if IIS and VBScript were structured just a little
different, would have been to "include" all the Class'es once in something
like a Global.asa (actually, a more suitable library of sorts) and then be
able to utilize those Class'es simply by reference in the rest of the
application. Of course, if that were possible, I would also want my GDE to
be aware of those add-on Class'es and provide me with hints (and error
alerts) as the code gets developed maybe even going as far as something
Borland did with their Java GDE. (It would also provide the comments in the
hint if function-level comments existed.)

The dreaming eventually ends and we return to our regularly scheduled
nightmare.

Thanks for sharing your ideas though. Maybe I will be fortunate enough to
dig into ASP.NET before it becomes obsolete ... or maybe I will just wait it
out until the next new thing.
Oct 26 '05 #7
"MyndPhlyp" <no****@homeright.now> wrote in message
news:ud**************@TK2MSFTNGP10.phx.gbl...
I am building up a library of Class'es that represent various columns of
table layouts. One often used column is "name" and each occurrence is
treated identically. (What a concept, eh?)

Part of that library of Class'es includes representations of various
tables.
(Just let me know if you see a trend going on here.) These Class'es use
the
column Class'es.

What I would like to do, but I have yet to find a way around duplicated
names, is to place all the necessary supporting column Class #include's in
the table's Class so that I need only place the table's Class in the
module
utilizing them.

I understand entirely why the "duplicate name" error occurs.

What I am looking for is a way around the conundrum that does not require
duplication of code. Any ideas?


You could do it with JScript. Here's a proof of concept that demonstrates
redeclaration of the clName class/object:

<script language="JavaScript" runat="SERVER">
function clName(sName){
this.Value = sName;
}

function clCompany(sName){
this.Name = new clName(sName);
}

function clName(sName){
this.Value = sName;
}

function clPerson(sLastName, sFirstName, sMiddleName){
this.LastName = new clName(sLastName);
this.FirstName = new clName(sFirstName);
this.MiddleName = new clName(sMiddleName);
}

var company = new clCompany("Hohmann Enterprises");
var person = new clPerson("Hohmann", "Chris", "George");
Response.Write("<br>Company: " + company.Name.Value);
Response.Write("<br>Person: " + person.LastName.Value + ", " +
person.FirstName.Value + " " + person.MiddleName.Value);
</script>
Notes:
1. You can still use VBScript for the rest of your programming, only your
classes would need to be written in JScript.
2. JScript also supports a much more robust object implementation which
includes functions-as-values, reflection, prototyping, nesting, etc...
--
May you be touched by His noodly appendage. RAmen.
http://venganza.org
Oct 27 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phil | last post by:
I am using a Pascal like language (Wealth-Lab) on W2K and call this server: class HelloWorld: _reg_clsid_ = "{4E797C6A-5969-402F-8101-9C95453CF8F6}" _reg_desc_ = "Python Test COM Server"...
9
by: Grim Reaper | last post by:
My work let me put SQL Server 7.0 Enterprise Edition on my laptop. I have never setup a server from the beginning, so I am a little new at creating server groups. Alright, I am trying to create...
0
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: ...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
4
by: coosa | last post by:
Hi, I was installing SQL Server on my machine and during installation my PC freezed. It happens frequently on my machine. So i tried after restarting to install it again and since then i always...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
10
by: sara | last post by:
Hi All, I was able to connect to MS SQL Server 2005 on my computer but after a while I can not. When I want to connect to it using MS SQL Server Management Studio I got this error: An error...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.