Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 8th, 2003, 03:54 AM
Authorized User
 
Join Date: Jun 2003
Location: Aalst, Vlaanderen, Belgium.
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.
Reply With Quote
  #2 (permalink)  
Old September 8th, 2003, 04:21 PM
Registered User
 
Join Date: Sep 2003
Location: , , .
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

Reply With Quote
  #3 (permalink)  
Old September 8th, 2003, 06:58 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
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.
Reply With Quote
  #4 (permalink)  
Old September 9th, 2003, 02:49 AM
Authorized User
 
Join Date: Jun 2003
Location: Aalst, Vlaanderen, Belgium.
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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 01: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 05:05 PM



All times are GMT -4. The time now is 10:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.