Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Redim 2D Array using PRESERVE

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,36
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Redim 2D Array using PRESERVE
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Redim 2D Array using PRESERVE - 5/23/2001 7:31:57 AM   
  pedx

 

Posts: 16
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
I have a combo from which i select values...as i select, i want the HTML table beneath to include the selection...I want all this manipulation done in the client-end itself. I am able to manage the table part of it. Now on submitting the form i have to write the selected items into the Database table. To do this, i use an array and redim the size with the PRESERVE keyword each time the select button is clicked. But the values don't get preserved in the Array. Wat cld be the prblm? Or how else can i achieve this task if i dont use Arrays?
PS: All manipulations have to done as client-side scripts using VBScript only.
-------------------
CODE
-------------------
count=0
if count = 0 then
redim arrStore(0,3)
else
redim Preserve arrStore(count,3)
end if
...
count=count+1
--------------END OF CODE----------------
 
 
Post #: 1
 
 Re: Redim 2D Array using PRESERVE - 5/23/2001 7:37:46 AM   
  Mighty

 

Posts: 11
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
At the start of your code you have set count=0. Then you increment count at the end. However, this increment doesn;t matter if you initialise it to zero each time.

(in reply to pedx)
 
 
Post #: 2
 
 Re: Redim 2D Array using PRESERVE - 5/23/2001 7:39:18 AM   
  pedx

 

Posts: 16
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
Oops! The count ought to come outside the function call n the processin is done inside the function. Well, i hope i have conveyed the prob..although i messed up in the code extracts!

(in reply to pedx)
 
 
Post #: 3
 
 RE: Re: Redim 2D Array using PRESERVE - 3/31/2006 5:42:46 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Very old question, but to help the searchers, I will point out that only the lat dimension of a multi-dimension array can be redimmed.


EDIT: Typo ...grumble...grumble...stupid fat fingers...grumble...grumble...

< Message edited by ebgreen -- 3/31/2006 5:54:10 AM >


_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to pedx)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Redim 2D Array using PRESERVE Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts