Subclass problem w/ classic VBScript on IIS 5

Discussion in 'ASP General' started by MyndPhlyp, Oct 24, 2005.

  1. MyndPhlyp

    MyndPhlyp Guest

    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?
     
    MyndPhlyp, Oct 24, 2005
    #1
    1. Advertising

  2. MyndPhlyp

    MyndPhlyp Guest

    "Brian Staff" <brianstaff AT [NoSpam]cox DOT net> wrote in message
    news:...
    > > 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.
     
    MyndPhlyp, Oct 24, 2005
    #2
    1. Advertising

  3. MyndPhlyp

    Patrice Guest

    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" <> a écrit dans le message de
    news:...
    >
    > "Brian Staff" <brianstaff AT [NoSpam]cox DOT net> wrote in message
    > news:...
    > > > 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.
    >
    >
     
    Patrice, Oct 25, 2005
    #3
  4. MyndPhlyp

    MyndPhlyp Guest

    MyndPhlyp, Oct 25, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jstorta
    Replies:
    3
    Views:
    446
    jstorta
    Feb 20, 2006
  2. MyndPhlyp
    Replies:
    7
    Views:
    214
    Chris Hohmann
    Oct 27, 2005
  3. S.Volkov
    Replies:
    2
    Views:
    221
    S.Volkov
    Mar 12, 2006
  4. Trans
    Replies:
    8
    Views:
    323
    Robert Klemme
    Oct 23, 2008
  5. Fab

    Subclass of subclass

    Fab, Aug 9, 2012, in forum: C++
    Replies:
    0
    Views:
    396
Loading...

Share This Page