using Arrays in ASP

Results 1 to 2 of 2

Thread: using Arrays in ASP

  1. #1
    Join Date
    Dec 1969

    Default using Arrays in ASP

    Private arrLiterals() As Literal_type<BR><BR>Type Literal_type<BR> Litid As String<BR> text(2) As String<BR>End Type<BR><BR>arrLiterals(I).Litid &#039using in VB how should i use in ASP? <BR><BR><BR>pls do help it out

  2. #2
    Join Date
    Dec 1969

    Default Arrays of first class objects not supported...

    VBScript doesn&#039t provide any way to create *OR* access arrays of objects.<BR><BR>Sorry, but you are out of luck.<BR><BR>The closest you could come would be to all VBS to access the individual elements via ActiveX calls.<BR><BR>Maybe something like this:<BR><BR>&#060;%<BR>Set obj = Server.CreateObject("Literals.Array")<BR>obj.Array Size = 100 &#039 create an array of 100 Literal_Type elements<BR>obj.SetElement( 3, "First ID", "text1", "text2" ) &#039 initialize element 3 of the array<BR>...<BR>litid = obj.GetLitid( 7 ) &#039 get the Litid field of element 7<BR>...<BR>etc.<BR>%&#062;<BR><BR>Although VBScript now supports the notion of a Class, these in-language classes do *not* create "first class" objects (they are actually a special kind of collection...same as with JavaScript), so they can&#039t be stored in a COM-compatible array and they can&#039t be used as a template to overlay a COM-compatible array. <BR><BR>NOW...all of this changes with ASP+, where you can script in true VB and/or C#. <BR><BR>But with ASP, per se, you are out of luck.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts