struct in asp

S

smj92I

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

struct s_my_table {

string name,
string sexe,
int age,
}


thanks
 
O

only me

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
 
T

Tia

smj92I said:
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
 
R

Ray at

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top