Subscripts And Dynamic Multi-dimensional Arrays

I am trying to create a dynamic multi-dimensional array, based on a count from a database. The count is correct, but when I try to Redim preserve my array, I get an error...

Subscript out of range

referring to the line of code...

ReDim Preserve builderArray(CInt(builderCount),5)

How can I do this redim successfully?

View Replies


ADVERTISEMENT

Creating Multi Dimensional Arrays On The Fly

I am trying to setup a 2 dimensional array which i can populate on the fly with data coming frtom a database.

I understand that you have to set a specfic size for the array in ASP, but I am looking at making the array dynamic and using the Redim function to increase the size by 1 each time. Code:

View Replies View Related

Two Dimensional Arrays

how to get and assign the first dimension of a two dimensional array to another array? For example, I have a recordset object (rsObj) and then I take that object and assign to array (via GetRows() method). I would like to take just the first dimension and assign to another array, but I get a "Subscript Out of Range" error.... any ideas?

temp_array = rsObj.GetRows
new_array = temp_array(0)

View Replies View Related

Multi Dimensional Array In Form

what i want to do is have a (multi dimensional?) array, so that each second dimension represnts a row of radiobuttons. The trouble is i don't know what to name the arrays as. Obviously for each row the names for the different radio buttons will be the same, meaning you can only select one.

in php you could do it with a single array as you name each row of radio button differently:

1st row:
name='array[0]'
2nd:
name='array[1]'

in asp it doesn't look like you can do it this way, because to create a similar array you'd do something like
1st row:
name='array'
2nd
name='array'

then use split in the recipient script. This does not work however, because each radiobutton (on all rows) has the same name, and therefore when you click one all the rest on every row are unclicked..

View Replies View Related

Storing Dimensional Arrays

Does anyone know how to store multi-dimensional arrays in the Application object? And if so please show an example.

Also, how do you loop through multi-dimensional arrays? I just can't seem to get my head wrapped around this.

View Replies View Related

Various Basic Questions Regarding Two-dimensional Arrays

I would like to know how many rows and columns are created in the following array. Is it 10 rows and 2 columns or is it 10 columns and 2 rows? Dim Array(9,1)

I have searched for some info about it but not found any consensus. Some sources claim that the first number symbolizes the rows and the second number the columns and other sources claim the opposite. I am confused.

What is it really like? How many rows and columns?

Assume that I need an array with 2 columns and 5 rows then how should it be declared (4,1) or (1,4)?

Which is the first dimension and which dimension it the second one? Horizontally (first/second) vs vertically (first/second)?

How are the various elements called, for example how is the element on the first row in the 5th column called. By using (0,4) or (4,0)?

Assume that I want to store first and last names in two separate columns in an array and then expand the array by using Redim/preserve. The dimension I want to expand is the one with the rows because I view the array as a table with two columns.

I know there are certain rules that apply when it comes to using Redim/preserve on multidimensional arrays. Only the last dimension can be changed etc. How could that be done in this case? I am mainly interested in the declaration (1,x) or (x,1), where 1 is the number of columns and x number of rows (that is increased).

View Replies View Related

Multi Level Arrays

How do I create an array inside an array? This certainly doesnt work...

Dim TmpArray(0 to 10)(0 to 50)

View Replies View Related

Splitting Multi Select Item Into Arrays

I know that I can use instr(input,1) etc. but my attempts so far are of little use.

View Replies View Related

.:·Dynamic Multi-dymansional

As part of the development of a shopping basket function, I've a two dimensional aray which I'm storing in the session variable.
I want the array to be dynamic to store any amount of products which may added.

I am getting a problem when trying to write to the second row to the array, saying that the subscript is out of range...
You can see an example of this at:
http://www.foulkestudios.com/session.asp

I am getting what should be the first empty row by getting rows=UBound(myArray,2)
I'm then trying to add into the next row by using rows + 1

View Replies View Related

Multi-Dimentional Dynamic Array

I want to save the details of a SQL search into an Array, Im dabbling and tryin the script below but i get an error Script:

SQL = "select item, number from table"
Set rsTarg = Conn.Execute(SQL)

i = 0

Dim TargArray()
Redim TargArray(i, 1)

do until rsTarg.eof

TargArray(i, 0) = rsTarg("item")
TargArray(i, 1) = rsTarg("number")

i = i + 1

Redim Preserve TargArray(i, 1)

rsTarg.movenext
loop

rsTarg.close

i = i -1

View Replies View Related

Dynamic Arrays

i want to create a dynamic list or array in asp as we have arraylist in asp.net. what i want is that i want to hold the values selected by the user in a list and in advance i dont know that how much values the user will select. i also tried to use array with redim but that did not work as we can create array with only constant integer parameter.

View Replies View Related

Dynamic Multidimensional Arrays

I get error when I try to ReDim and Preserve a Dynamic Multidimensional Array. Code:

View Replies View Related

Freeing Dynamic Arrays

Do dynamic arrays declared using ReDim have to be freed? I assume that
if it's an array of dynamically created objects (e.g.
Scripting.Dictionary), each one of those objects will have to be set
to Nothing in a for loop, but what about the array itself?

Or what if the array is dynamic but it just consists of integers or strings, not
dynamically allocated objects? Does it have to be set to Nothing?

View Replies View Related

Freeing Dynamic Arrays

Do you have to manually release memory allocated by creating a dynamic array using ReDim? In other words, if I have the following code:

ReDim Test(1000)
For i = 0 To 1000
Test(i) = "test value " & i
Next

Do have I have set Test = Nothing to prevent a memory leak?

View Replies View Related

One Dimensional Array

If I have an Array declared like this:

MyArray = array (“value 1”, “value 2”, value 3”)

Will this array physically be a long single row or a single column (like below)?

Value 1 value 2 value 3

Or

Value 1
Value 2
Value 3

View Replies View Related

Looping Through Tw-dimensional Array

I need to loop through a two-dimesnional array (x,y) until a value in x is empty or the end of the array is reached, whichever comes first. Example array:

Dim myArray(4,1)

myArray(0,0) = "part 1"
myArray(0,1) = quantity
myArray(1,0) = "part 2"
myArray(1,1) = quantity
myArray(2,0) = "part 3"
myArray(2,1) = quantity
myArray(3,0) = ""
myArray(3,1) = quantity
myArray(4,0) = "part 5"
myArray(4,1) = quantity

In the example above, the loop should stop once it determines myArray(3,0) is empty. If myArray(3,0) was not empty, the loop would continue until the end of the array was reached. Anybody have a code example to do this?

View Replies View Related

Two-Dimensional Array Resizing

how do I resize a two-dimensional array? The array I'm working with is "data(X)(Y)" where X is 0 or 1 and Y grows to a dynamic number.If "data(1)(highest element)" IsNull, then I need to strike it from the array. I believe this should be doable by simply resizing the second dimension down by one. Through researching I established the following set of code:

I = UBound(data(0)) - 1
ReDim Preserve data(2,I)

But it results in a "Subscript out of range" message on the latter line. Short of looping through and building a new array.

View Replies View Related

ADODB Versus 2-Dimensional Array

I'm working on developing (yet another) shopping cart for my work. I was wondering if anybody knows which approach leaves a smaller footprint in memory on a server: an ADODB Recordset which stores arrays one-dimensional arrays or a two-dimensional array?

We are currently hosing our web site on a shared machine at Verio. The cart I have to build needs separate carts because a customer's products can come from different locations. Each location will have a different cart. On the cart page itself, I would like to display each cart in a separate location.

Logically, it make the most sense (to me, anyway) to use an ADODB Recordset to manage each individual cart (array) than to write the code to manage the arrays. What are the disadvantages of using ADODB recordset instead of a two-dimensional array in this case?

Which approach would be easier to manage and manipulate? Are there any reasons why I shouldn't use a two-dimensional array? The nice thing about ADODB is that I will not need to program certain features and have access to FILTERS.

Any suggestions about how each approach would scale as site traffic increases? Will one approach bog down the server more than the other? I'm also open to suggestions about a possible, yet illusive, 3rd way.

View Replies View Related

Vbscript Mutli Dimensional Array

I understand the logic behind a multi dimensional array (sort of). What I need to do is be able to capture the product information (that is in a product session) that a user has selected and email it to a specific address.

The email coding page is written in javascript. This page is already being used to also send the customer credit information. If anyone has some insight in this I would be very appreciative. Code:

View Replies View Related

How Can I "ReDim" A Two-dimensional Array?

I guess one should declare the array using empty brackets.

Dim MyArray()

Later I set MyArray to:

Redim MyArray(2,3)

The problem comes now. How should I use Redim again? I have heard that only one of the two dimensions can be enlarged or decreased. Is that correct? If so, which dimension would be ok to set to 5 in MyArray. Is ReDim MyArray (2,5) correct or should it be (5,2)?

View Replies View Related

Dynamic Calendar, Need To Create Dynamic Array....

I code that creates a calendar for each month and then it displays events from that month that are stored in a db. I need to loop through my recordset and display all the events, but I can't quite figure out how to do it. I am thinking I need to do an array. But I am not really sure.... any ideas. Here is where you can view the calendar. Code:

View Replies View Related

Multi-purpose DLL

I released to open source a while back but forgot to post in here a DLL that was used in some of our older developments. It's not really a live project, but may be of use to peeps in here given some of the recent queries:Quote:

DBSite: Written in Visual Basic this DLL helps solve issues for ASP web developers, e.g. handling uploads, safe parameter population for stored procedures (sql injection checks), SQL XML calls, file system browsing, etc.

View Replies View Related

Multi-language

I was trying:
Code:
<!--#include file="lang/<%= Request.QueryString("lang") %>.asp"-->
But it doesn’t work.

View Replies View Related

Multi Tab Page

How can i create a multi tab page in asp.net 2.0?
create a frame and a number of page with hyperlink?
Would i have some directives?

View Replies View Related

Multi Tables

How can I update/delete a record which is linked to another table with a
unique field. I know the select inner join, but no update/delete.

View Replies View Related

Multi-join

Trying to join three tables and find the records which DON'T match OR have less than x number of matches.Not sure how to go about it.keep getting matching fields only.

View Replies View Related

Multi Page

I need to create in asp/access/javascript a questionnaire that shows a single question on each page of which there are five then after the last question create a new record in the access db and write the answers.

View Replies View Related

Multi Updates

lets say we have a ms db with two cols

id value
1 4
2 7
3 9
4 1

is there a simple way of updating all the value fields with one form? so i can have the page lay the four value's out in a list, the user could then edit them and hit update and this would update all the value fields. i can update single records no problem but have no idea where to start with this one.

View Replies View Related

Multi Database Connection

I have written a asp application whihc uses a number of pages and each page connects to a sql database.
Currently I have the connection script coded on each page however if i need to change the database I have to change every page.
I have been told there is a way to have the connection on one page and each page to referance this one so I only need to change the one page

View Replies View Related

Multi-user Applications

I am b-testing a community site, with currently 1,000 or so membership,
and low concurrency, say no more than 5 on-line at once.

The site is hosted on a shared server, which is sufferening from
intermittent accute slowness, affecting all other hosted sites as well as
mine.

The finger of suspicion is pointing at me and possible sloppy code. As
this is the first site I have done of this nature, could someone recommend
reading matter (knowledge bases etc), especially coding samples, in
connection with data connections (opening and closing connections and
objects) and record locking issues, which if improperly coded, could
contribute to throughput bottlenecks due to inefficient use of resources so
that I can check out my pages and correct any nasties..

View Replies View Related

Multi-server Code

I am think to write a code that will need more then 2 servers.

Can anyone give me some information to do code like that?

Like yahoo, google, msn.

View Replies View Related

Multi-page Application

I need to develop an application that will span 12 or so pages, and on the
last page, it lets the user review the data and then insert it all. This is
kind of like selling something on eBay, you give it information, click next,
enter more info and then at the end you review and submit the item. I was
thinking about sessions, but some of the fields are pretty big, like
varchar(5000) so I didn't know if there was a way to handle these big
fields.

View Replies View Related

Multi-Lingual Web Site

I am in the process of developing several web sites that will accommodate up to 3 or 4 languages. The sites are not that complex, but will use an Access database for some data presentation/storage. Each page will have a series of flags for respective languages. Ideally, if someone enters on a "gateway" page for say Gallery, and they choose another language, I would like the same page to display but in a different language (there might be a page for each language, but if I can avoid that I'd rather).
So here are my thoughts on how to approach this. Have a session var for language preference and set it in a Global.asa file. I would think it could be set dependant on the origin of the request, .de, .co.uk, .it, etc. Then, if the code is not too verbose, use Case statements in the code to display content based on language preference. One thing of a bit challenging for me is that if the "flags" are in an include file, how can I get them to when clicked go to a script, change the session variable and return to the page from which it was clicked. Am I on the right track with this approach.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved