Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 8th, 2003, 03:54 AM
Authorized User
 
Join Date: Jun 2003
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBScript : alternative way of resizing an Array ?

Hi,

Would someone please be able to tell me if there is a simple way of deleting an item in an array and resizing it [keeping the old values] ?

For instance, I have an array defined as :

Dim myArray(3)

myArray(0) = "A"
myArray(1) = "B"
myArray(2) = "C"
myArray(3) = "D"

I would like to remove myArray(1), and resize the whole thing back to myArray(2) [keeping the old content].

myArray(0) = "A"
myArray(1) = "C"
myArray(2) = "D"

Do I have to make a function for that or is there some methods I missed regarding the use of arrays ? Thanks for your advice.
 
Old September 8th, 2003, 04:21 PM
Registered User
 
Join Date: Sep 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

use the dictionary object instead - see the following link
http://www.w3schools.com/asp/asp_ref_dictionary.asp

 
Old September 8th, 2003, 06:58 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can use the ReDim Preserve option, although you may have to use SHIfT and UNSHIFT as well.
 
Old September 9th, 2003, 02:49 AM
Authorized User
 
Join Date: Jun 2003
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your help. Good to know what the Dictionary object does, will surely get this part investigated. The second option about the ReDim PRESERVE I know about, but using built-in array functionality seems a bit limited.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing Images san123 ASP.NET 1.0 and 1.1 Basics 2 April 26th, 2006 02:51 PM
Need Help with Resizing... alaamri HTML Code Clinic 3 August 29th, 2005 01:54 AM
Resizing form dotnetprogrammer VS.NET 2002/2003 0 February 23rd, 2005 02:58 AM
Resizing a dropdownlist Hussam_ahmad VS.NET 2002/2003 0 May 11th, 2004 06:08 AM
Key based array in VBScript? rgalehouse Classic ASP Basics 3 March 1st, 2004 06:05 PM





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