Re: Redim 2D Array Subscript Out Of Range Error

From: Alan Beban (alannospambeban_at_pacbell.net)
Date: 02/09/04


Date: Mon, 09 Feb 2004 13:00:33 -0800

Tom Ogilvy wrote:
> You will have to check with the OP on that - I wasn't debugging his code,
> just suggesting how to alter the array. After all, he was the one that said
> it worked fine as a 1D array, so I assume he left a line of code out. And
> actually it is the whole while Wend construct that loops, not just the code
> below !! NO ERROR HERE!!

I didn't say "the code below !! NO ERROR HERE!!"; I said "the code
below". The code that was below in my post began with Dim
varChargeArray() and ended with Wend.

>
> It would seem a real waste of resources to use some generalized array
> resizing routine when it is not required at all if the dimensions of the
> array are reversed as I suggested. Even doing an application.Transpose on
> each side is unnecessary.
>

I don't necesssarily disagree (though I'm always chary of accepting
claims of things like "a real waste of resources" in the complete
absence of any context whatsoever). I suggested an alternative in case
it isn't convenient for the OP to rearrange the dimensions of his stuff.
I'm comfortable letting a user decide what "resources" are relevant and
whether a generalized resizing routine might "waste" them.

Alan Beban



Relevant Pages

  • Re: RAID 1 in Windows 2000 Professional
    ... It does if you wish to use the existing mirror, what you are suggesting ... and then moving data from the existing hd to the new ... I dont believe it would be wise to use the current array and add ...
    (microsoft.public.win2000.hardware)
  • Re: Whats mex good for?
    ... In spite of Steve's claim that he is flamed for suggesting this, ... when you copy an array at the Matlab command line, ... initially duplicate the data array, just the mxArray structures, and it defers ... actually duplicate the data). ...
    (comp.soft-sys.matlab)
  • Re: pass by reference in each loop
    ... Robert Klemme wrote: ... My first thought was to store a list of all those variables in an array ... I don't think I understood what you were suggesting the first time. ... to use a hash, something like ...
    (comp.lang.ruby)
  • Re: Pointers vs References: A Question on Style
    ... >> But a pointer might be null or point to something that's been deleted. ... >You are suggesting ... ...which says, inter alia, 'Consequently "plain" reference arguments ... But why use array of const char when you have ...
    (comp.lang.cpp)
  • Re: [bisected][resend] pnp: Huge number of "io resource overlap" messages
    ... Are there any BIOS setup options ... I know you need to use at least the sound device, ... so I'm not suggesting that Linux should leave it disabled; ... If I were trying to figure out where we assign resources, ...
    (Linux-Kernel)

Loading