Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

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.



Report this thread to moderator Post Follow-up to this message
Old Post
Roy Danon
03-30-05 08:57 AM


Re: classes in vbscript
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"



Report this thread to moderator Post Follow-up to this message
Old Post
Bob Barrows [MVP]
03-30-05 01:55 PM


Re: classes in vbscript
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"



Report this thread to moderator Post Follow-up to this message
Old Post
Bob Barrows [MVP]
03-30-05 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:00 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.