[jawsscripts] Re: how to use StringArray

  • From: Andrew Hart <ahart@xxxxxxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Tue, 12 Feb 2013 17:57:07 +1000

On 10/02/2013 12:02 PM, Jim Snowbarger wrote:
> Nah, let other people stumble on it too.

lol

> Just curious, If you rite a function that accepts a string array argument,
> can that function determine the number of strings in the array?  Or, would
        > you use the ForeEach construct to enumerate them.  Array types in 
JAWS scripte really are just simple arrays, much like in C/C++.  For getti

I don't know of a JAWS script function that can tell you the length of a 
StringArray.  ForEach won't work here as it is designed to work on 
Objects such as Collections which are armed with iterators. 
StringArrays in JAWS script seem to be simple array structures much like 
what is available in C/C++.

For getting the length of an array, you could use a function like the 
following, but it relies on the StringArray containing no empty values 
and hence is not fullproof.

Int Function StringArrayLength(StringArray s)
Var
   Int i
i = 0
While StringLength(s[i+1])>0
   i = i+1
EndWhile
Return i
EndFunction

Cheers,
Andrew.


__________�

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

Other related posts: