I am working with Classes in classic VBScript on IIS 5.0 and am having a
problem wrapping my head around a solution.

I have a Class defining a record layout. (Bear with me here as I completely
roach the OOP language.) The objects are columns of the record and each
column is defined as its own Class.

The record layout class has a method called Column(str) that returns the
subclass's object. The subclass, in turn, has a Property Get (and a
corresponding Property Set) called Value. This allows me to make a
references like:

strField = objRecord.Column("mycolumn").Value

objRecord.Column("mycolumn").Value = strField


All that works fine and dandy.


The problem is getting a default behavior. I want to make the reference:

strField = objRecord.Column("mycolumn")

and retrieve Value from the subclass. What I get from IIS is "Object doesn't
support this property or method". I would expect that statement to trigger
the Property Get for the subclass.


Any ideas? Or am I just expecting too much from classic VBScript?

Re: Subclass problem w/ classic VBScript on IIS 5 by Brian

Brian
Mon Oct 24 14:38:47 CDT 2005

> The record layout class has a method called Column(str) that returns the
> subclass's object.

> strField = objRecord.Column("mycolumn")

If the method called Column is returning an object, then shouldn't you be
coding it like this:

set strField = objRecord.Column("mycolumn")

Brian


Re: Subclass problem w/ classic VBScript on IIS 5 by MyndPhlyp

MyndPhlyp
Mon Oct 24 16:48:08 CDT 2005


"Brian Staff" <brianstaff AT [NoSpam]cox DOT net> wrote in message
news:VA.000002fe.33e7a762@bstaffw2k.jda.corp.local...
> > The record layout class has a method called Column(str) that returns the
> > subclass's object.
>
> > strField = objRecord.Column("mycolumn")
>
> If the method called Column is returning an object, then shouldn't you be
> coding it like this:
>
> set strField = objRecord.Column("mycolumn")

If I wanted to return the field as an object, yes. But I want only the Value
property and not the whole object. Since the statement I used as an example
is an assignment to a variable, and since objRecord.Column("mycolumn") is
the object that contains the Value, I want the default action of the
assignment's object to be Property Get Value rather than having to append
the Value property to each statement.



Re: Subclass problem w/ classic VBScript on IIS 5 by Patrice

Patrice
Tue Oct 25 03:08:11 CDT 2005

According to
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsstmPropertyGet.asp
you should be able to use the "Default" keyword to indicate that Value is
the default property for this class...

--
Patrice

"MyndPhlyp" <nobody@homeright.now> a écrit dans le message de
news:uBHZgSO2FHA.3788@tk2msftngp13.phx.gbl...
>
> "Brian Staff" <brianstaff AT [NoSpam]cox DOT net> wrote in message
> news:VA.000002fe.33e7a762@bstaffw2k.jda.corp.local...
> > > The record layout class has a method called Column(str) that returns
the
> > > subclass's object.
> >
> > > strField = objRecord.Column("mycolumn")
> >
> > If the method called Column is returning an object, then shouldn't you
be
> > coding it like this:
> >
> > set strField = objRecord.Column("mycolumn")
>
> If I wanted to return the field as an object, yes. But I want only the
Value
> property and not the whole object. Since the statement I used as an
example
> is an assignment to a variable, and since objRecord.Column("mycolumn") is
> the object that contains the Value, I want the default action of the
> assignment's object to be Property Get Value rather than having to append
> the Value property to each statement.
>
>



Re: Subclass problem w/ classic VBScript on IIS 5 by MyndPhlyp

MyndPhlyp
Tue Oct 25 06:25:12 CDT 2005


"Patrice" <nobody@nowhere.com> wrote in message
news:%23ZSr$sT2FHA.2604@TK2MSFTNGP12.phx.gbl...
> According to
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsstmPropertyGet.asp
> you should be able to use the "Default" keyword to indicate that Value is
> the default property for this class...

Cool. That is exactly what I was looking for. Thanks.