help on storing info in arrays

Results 1 to 2 of 2

Thread: help on storing info in arrays

  1. #1
    safz Guest

    Default help on storing info in arrays

    I&#039m developing a online test. All questions come one per page and each answer(checkboxes) is submitted. This info I dont want to post each time to the database, instead want to store it in an array . At the end of the test, I want to send the array info into the database. <BR>how is this done ? <BR>please help

  2. #2
    Join Date
    Dec 1969

    Default RE: help on storing info in arrays

    To get this to work you are going to have to use Session varibles. These only work with browsers that support cookies and have cookies enabled, but that should be fine as most do.<BR><BR>First create an array then store it in you Session varible.<BR><BR>Dim MyArray(20) &#039This create a 0 based array that has room for <BR> &#039 20 slots 0-19<BR>Session("MyArray") = MyArray &#039Store the array in the Session Var<BR><BR>You can&#039t alter the array while its stored in the Session Var so at the top of each page where you need to use it you need to copy the array to another array if you know what I mean, like this:<BR><BR>Dim MyArray &#039No need to say how big it is this time if you don&#039t <BR> &#039want to<BR>MyArray = Session("MyArray")<BR><BR>To store stuff in the array just use something like this :<BR><BR>MyArray(0) = "Hello"<BR><BR>This stores the string hello in the first slot of the array. Going back to what I said eariler typeing Session("MyArray(0)") = "Hello" will not work.<BR><BR>Hope that helps<BR><BR>Pete

Posting Permissions

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