struct in asp

Discussion in 'ASP General' started by smj92I, Jul 15, 2003.

  1. smj92I

    smj92I Guest

    how can i have in asp the equivalent (in C++) of this:

    struct s_my_table {

    string name,
    string sexe,
    int age,
    }


    thanks
     
    smj92I, Jul 15, 2003
    #1
    1. Advertising

  2. smj92I

    only me Guest

    assuming it the same as in old C (and I think it is)

    you can think of the table as an array of records, just like a DB table,
    with th named fields of the indicated datatypes

    so to refer to the Nth table elements age, you would use soemthing like

    x = s_my_table(n).age

    so in summary probably quicker/simpler just to write this data in to a DB
    table an be done with it


    "Curt_C [MVP]" <Software_AT_Darkfalz.com> wrote in message
    news:...
    > for those of us unfamiliar with C++ how about a description
    >
    > --
    > ----------------------------------------------------------
    > Curt Christianson (Software_AT_Darkfalz.Com)
    > Owner/Lead Designer, DF-Software
    > http://www.Darkfalz.com
    > ---------------------------------------------------------
    > ..Offering free scripts & code snippits for everyone...
    > ---------------------------------------------------------
    >
    > "smj92I" <> wrote in message
    > news:bf1v34$bki$...
    > > how can i have in asp the equivalent (in C++) of this:
    > >
    > > struct s_my_table {
    > >
    > > string name,
    > > string sexe,
    > > int age,
    > > }
    > >
    > >
    > > thanks
    > >
    > >

    >
    >
     
    only me, Jul 16, 2003
    #2
    1. Advertising

  3. smj92I

    Tia Guest

    "smj92I" <> wrote in message
    news:bf1v34$bki$...
    > how can i have in asp the equivalent (in C++) of this:
    >
    > struct s_my_table {
    >
    > string name,
    > string sexe,
    > int age,
    > }
    >
    >



    What language was that again?
    I think you're looking for the VB ' Type ' statement (user-defined data type),
    which AFAIK is not "in asp". Look at the Class object and Property Get/Let/Set
    instead maybe, or just use an array?

    'VBScript has only one data type called a Variant.'


    HTH
     
    Tia, Jul 16, 2003
    #3
  4. smj92I

    Ray at Guest

    You can use structures in asp.net or you can create classes in VBScript

    Example:

    <%
    Dim x
    Set x = New Something
    Response.Write x.Name & "<br />"
    Response.Write " - not yet set, will set it to ""Jorg.""<br />"
    x.Name = "Jorg"
    response.write x.Name
    Set x = Nothing


    Class Something

    Private sSetName

    Private Sub Class_Initialize()
    sSetName = "default"
    End Sub

    Public Property Get Name()
    Name = sSetName
    End Property

    Public Property Let Name(sName)
    sSetName = sName
    End Property

    End Class
    %>

    Ray at home

    "smj92I" <> wrote in message
    news:bf1v34$bki$...
    > how can i have in asp the equivalent (in C++) of this:
    >
    > struct s_my_table {
    >
    > string name,
    > string sexe,
    > int age,
    > }
    >
    >
    > thanks
    >
    >
     
    Ray at, Jul 16, 2003
    #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. RA Scheltema
    Replies:
    3
    Views:
    404
    RA Scheltema
    Jan 6, 2004
  2. Gunnar G

    struct in struct

    Gunnar G, May 31, 2004, in forum: C++
    Replies:
    14
    Views:
    806
  3. DanielEKFA
    Replies:
    8
    Views:
    616
    DanielEKFA
    May 16, 2005
  4. James Harris
    Replies:
    4
    Views:
    1,396
    James Harris
    Oct 9, 2003
  5. Chris Fogelklou
    Replies:
    36
    Views:
    1,391
    Chris Fogelklou
    Apr 20, 2004
Loading...

Share This Page