Another Array Issue

Results 1 to 2 of 2

Thread: Another Array Issue

  1. #1
    Jack McClure Guest

    Default Another Array Issue

    I&#039m trying to us an array to list a bunch of field responses. I figure if i use a dynamic array, then i can just use the ubound and lbound functions to perform a for/next control. My problem is that i don&#039t know how to populate the array. Below is a sample of my attempt to code it. Can anyone Please assist me?<BR><BR>&#060;%<BR>product = request.form("product")<BR>&#060;%<BR>dim selected()<BR>dim high, low <BR> selected() = product<BR> high = ubound(selected)<BR> low = lbound(selected)<BR> for counter = low to high%&#062;<BR>&#060;% next %&#062;<BR>

  2. #2
    NullVoid Guest

    Default RE: Another Array Issue

    &#060;%@ Language=VBScript %&#062;<BR>&#060;%<BR><BR>CONST dsn_info="XXXXXXXXXXXXXXX"<BR>Set Myconn=server.createobject("ADODB.connection")<BR> Myconn.open(dsn_info)<BR> <BR><BR> Mycount = 0<BR> dim Myarray() <BR> Redim Myarray(150)<BR> SET rsDIVSEC = Myconn.Execute ("SELECT * FROM DivSec where ID = &#039" & Session("GroupID") &"&#039" )<BR> <BR> WHILE NOT rsDIVSEC.EOF <BR> <BR> <BR> Myarray(Mycount) = rsDIVSEC.Fields("Division")<BR> Mycount = Mycount + 1<BR> <BR> <BR> rsDIVSEC.movenext<BR> <BR> WEND<BR> <BR> y= Ubound(Myarray)<BR> Response.Write ("Original Array size: " & y & "<BR>")<BR> <BR> Redim Preserve Myarray(Mycount)<BR> x = Ubound(Myarray)<BR> Response.Write ("The Dynamic array size:" & x & "<BR>")<BR> Response.Write ("The session array size: " & ubound(session("divarray")) & "<BR>")<BR> Response.Write ("Ubound session array : " & Ubound(session("divarray")) & "<BR>" )<BR> <BR> Response.Write ("LBound indice of session array: " & session("divarray")(Lbound(session("divarray")))& "<BR>")<BR> <BR> Response.Write ("LBound indice +1 of session array: " & session("divarray")(Lbound(session("divarray"))+1) & "<BR>")<BR> <BR> Response.Write ("Ubound indice of session array : " & session("divarray")(Ubound(session("divarray")))& "<BR>" )<BR> <BR> Response.Write ("Ubound -1 indice of session array: " & session("divarray")(Ubound(session("divarray"))-1)& "<BR>")<BR> <BR> Session("DivArray") = Myarray<BR> LocalArray = Session("DivArray")<BR> Response.Write ("<BR>Retrieving from Local Array - Array Size:" )<BR> Response.Write (ubound(LocalArray) & "<BR>") <BR> <BR><BR> <BR> <BR>%&#062;<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
  •