ArrayRange

Build an array out of a range of numbers or using our range syntax: {start}..{end} or using the from and to arguments

You can also build negative ranges

 arrayRange( "1..5" )
 arrayRange( "-10..5" )
 arrayRange( 1, 500 )
 

Method Signature

ArrayRange(from=[any], to=[numeric])

Arguments

Argument
Type
Required
Description
Default

from

any

false

The initial index, defaults to 1 or you can use the {start}..{end} notation

1

to

numeric

false

The last index item, or defaults to the from value

Examples

Create an array of sequential numbers using the string syntax.

Run Example

arr = arrayRange( "2..5" );
writeOutput( "This array has " & arrayLen( arr ) & " elements." );

Result: This array has 4 elements.

Create an array of sequential numbers using the string syntax.

Run Example

arr = arrayRange( 5, 10 );
writeOutput( "This array has " & arrayLen( arr ) & " elements." );

Result: This array has 6 elements.

Last updated

Was this helpful?