[jawsscripts] Re: Resizing arrays

  • From: Soronel Haetir <soronel.haetir@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx, Doug Lee <doug.lee@xxxxxxxxxxxxxxxx>
  • Date: Thu, 5 Jan 2012 08:05:17 -0900

I haven't tried it, but I would expect that just creating a new array
would work, you would need a temporary if you wanted to retain the old
values.  I don't think there is a way to simply resize an array while
retaining the current values.

On 1/5/12, Doug Lee <doug.lee@xxxxxxxxxxxxxxxx> wrote:
> In the absence of knowledge of a way to do that, I've been using
> collections as dynamic arrays, where the keys are things like
> intToString(i).  You do need to stringify the keys though. When I do
> that, I also sometimes include a count key that I keep updated when
> adding or removing elements. This also allows for efficient sparse
> arrays but does complicate their management a bit and precludes things
> like inserts/deletes where elements slide in to fill the hole or make
> room.
>
> On Thu, Jan 05, 2012 at 10:17:13AM -0600, Travis Roth wrote:
> Is it possible to resize arrays in JAWS script?
> It appears that the arrays are dynamically sized at runtime because the new
> keyword is used.
> But the documentation on the website does not seem to discuss destroying or
> resizing arrays?
> This may not be an issue for local variables, but I am thinking for a global
> array where at some point it may be desireable to store something larger
> than was originally set for.
>
>
>
> __________???
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
> --
> Doug Lee, Senior Accessibility Programmer
> SSB BART Group - Accessibility-on-Demand
> mailto:doug.lee@xxxxxxxxxxxxxxxx  http://www.ssbbartgroup.com
> "While they were saying among themselves it cannot be done,
> it was done." --Helen Keller
> __________�
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
>


-- 
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: