473,386 Members | 1,819 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,386 software developers and data experts.

classes in vbscript

Hi,
i'm trying to create a class which one of its properties is another class.
this is what i'm basicly trying to do :

public bbb
public aaa
end class

class bugi
public ccc as new subbugi
public ddd
end class

set a=new bugi
a.ccc.aaa="ds"
the problem is that for somereason this doesn't work.
any solutions?
Roy.
Jul 22 '05 #1
2 1116
Roy Danon wrote:
Hi,
i'm trying to create a class which one of its properties is another
class.
this is what i'm basicly trying to do :

public bbb
public aaa
end class

class bugi
public ccc as new subbugi
This is not legal in vbscript where all variables are variants.

Besides, I don't see where the subbugi class is defined. Are we supposed to
assume it's defined somewhere? Oh wait! Was "public bbb" supposed to be
"class subbugi"? If so, this may work:

private _ccc
public Property Get ccc
set ccc=_ccc
End Property
Private Sub Class_Initialize
Set _ccc=New subbugi
End Sub

public ddd
end class

set a=new bugi
a.ccc.aaa="ds"
the problem is that for somereason this doesn't work.
any solutions?


What does "doesn't work" mean? Error messages? Machine freezes?

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #2
Bob Barrows [MVP] wrote:
If so, this may work:

private _ccc
public Property Get ccc
set ccc=_ccc
End Property
Private Sub Class_Initialize
Set _ccc=New subbugi
End Sub

Hmm, I overthought that one. This should be all that you need:

Public ccc
Private Sub Class_Initialize
Set ccc=New subbugi
End Sub
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #3

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

Similar topics

7
by: A Ratcliffe | last post by:
As you might have gathered from the Subject, I've been experimenting with using VBScript classes in my ASP pages to tidy the script up. Generally things are going well. Since I come from a C++...
8
by: CJM | last post by:
For the majority of my work, I just use plain ASP. On the rare occasion that I am doing something intensive that does require user interaction I might create a COM component (ie where performance...
29
by: Christopher Brandsdal | last post by:
If I have a .ASP page that runs JScript code - is it possible to include an ..ASP page that runs VBscript???
1
by: | last post by:
I'm going a little crazy trying to learn how to use arrays as properties in VBScript classes. Hopefully someone can help. First, I can't figure out whether it's possible to iterate through the...
132
by: Kevin Spencer | last post by:
About 2 years ago, and as recently as perhaps 1 year ago, I can recall seeing many posts about what language to use with ASP.Net. The consensus was that employers paid more for C# programmers, and...
2
by: Noozer | last post by:
I've always had problems getting my head around using collections and classes together. Separately, they seem like fairly simple subjects, but I'm getting muddled up when trying to use them...
10
by: Noozer | last post by:
I'm writing an ASP application and have a noob question... I have a class that access an MS SQL database. I have another class also accesses an MS SQL database and this second class uses objects...
9
by: Ugur ASLAN | last post by:
Hello, I want to implement a class structure that can take a querystring and the value of querysting can be called as myClass.getQuery("test").value. I know that I can do it like...
1
by: gomzi | last post by:
I would like to know whether vbscript also provides facilities for all the classes that are available in vb.net i.e. i have a program written using vb.net which executes on the click of a button,...
7
by: Bruce | last post by:
I've been searching for some information on the use of Classes in ASP, but found very little information. I found this http://www.daniweb.com/tutorials/tutorial19997.html . Are there more...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.