Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 19th, 2014, 06:01 AM
RFS RFS is offline
Registered User
 
Join Date: Sep 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 2 for to ubound arrays

Hi I'm having trouble getting data from 2 arrays to place in a subroutine:

Code:
<%
Dim delv_array
		delv_array = Split(Request.Form("delv_no"), ",")
		'Iterate through the array inserting tracking numbers for each delivery
		for x = 0 to ubound(delv_array) %>
		<br><br><%response.write(delv_array(x))%><br><br>
			<%for lineitem=0 to uBound(rspartarray) %>
			<br><br><%response.write(rspartarray(lineitem,0))%><br><br>
			<%Call ScomUpdateDate( trim(delv_array(x)),rspartarray(lineitem,0))	
		next
		next
	End if
	%>
The first next returns 1 value as expected but the 2 second next returns all of the array however I only require 1 value at a time, is there away to tell the for next to run once each time rather the then looping through all of the array everytime the first for ubound is run?

Many thanks

RFS
 
Old September 21st, 2014, 07:39 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

It sounds like your design approach wrong. Why would you have the second For loop if you never want to iterate through all of the records?

If you have a for loop and then want to do something once inside that for loop get rid of the nested for loop and just do the one thing you want to do. Or have I mis understood your post?

If not, where does 'rspartarray' come from? If this is a record set for example perhaps just execute a query inside your first for loop to get the correct 'rspartarray' value to pass into your routine...
__________________
Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
ubound and array jpaul Pro VB Databases 4 January 29th, 2008 01:48 PM
arrays ozPATT Excel VBA 2 November 4th, 2005 06:11 AM
Multidemmesional Arrays OR arrays gmoney060 Classic ASP Basics 3 November 1st, 2004 03:42 PM
Arrays tajin Excel VBA 0 June 20th, 2004 09:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.