Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: 2-dimensional array


Message #1 by d.van.herk@w... on Fri, 6 Sep 2002 15:17:39 +0200
hi you all,

i've got a question which concerns a 2-dimensional array.

first I declare the array as array(6,10)
then I fill the array with data (experimental fase, so i do this
by putting it inside of the code, like array(0,0)="21/03/1977", etc)

when the araay isn't big enough, but the data must be stored so the array
should be array(6,11). I found out this can be done by the following code:

CurRecords=ubound(array,2)
REDIM PRESERVE array(6,CurRecords+1)

But when I use it, I get the following statement.

Error Type:
Microsoft VBScript runtime (0x800A000A)
This array is fixed or temporarily locked

the line it referers to is: "REDIM PRESERVE array(6,CurRecords+1)"

Hope, someone can give me a hint.

Greetings Dennis
(Student)




__________________________________________________________



Nieuw: Wanadoo ADSL Lite voor 27,95 euro per maand!





Meer informatie: http://www.wanadoo.nl/adsl
Message #2 by "Ken Schaefer" <ken@a...> on Sat, 7 Sep 2002 12:52:20 +1000
I hate to say this but you really should "read the manual" :-)

Download the VBScript Docs from here:
http://download.microsoft.com/download/winscript56/Install/5.6/W982KMeXP/EN-
US/scrdoc56en.exe

Goto "Index", and choose "Redim", and you will see that you can only use it
on certain types of array (that is explained). Also explained is how you
create those specific types of arrays. You are using the wrong declaration
to declare the array you wish to redimension.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <d.van.herk@w...>
To: "ASP Databases" <asp_databases@p...>
Sent: Friday, September 06, 2002 11:17 PM
Subject: [asp_databases] 2-dimensional array


: hi you all,
:
: i've got a question which concerns a 2-dimensional array.
:
: first I declare the array as array(6,10)
: then I fill the array with data (experimental fase, so i do this
: by putting it inside of the code, like array(0,0)="21/03/1977", etc)
:
: when the araay isn't big enough, but the data must be stored so the array
: should be array(6,11). I found out this can be done by the following code:
:
: CurRecords=ubound(array,2)
: REDIM PRESERVE array(6,CurRecords+1)
:
: But when I use it, I get the following statement.
:
: Error Type:
: Microsoft VBScript runtime (0x800A000A)
: This array is fixed or temporarily locked
:
: the line it referers to is: "REDIM PRESERVE array(6,CurRecords+1)"
:
: Hope, someone can give me a hint.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  Return to Index