Open topic with navigation

TIBCO GridServer® 7.1.0

# Construction

Arrays of primitive values can be constructed in several ways. A literal value is written as follows:

        a = [1, 2, 3, 4, 5]

Arrays can also be constructed by autorange expressions. The expression

        begin n end m step k

constructs an array starting with `n` and proceeding in increments of `k` until `m` is reached. More precisely, it constructs

        [n, n+k, n+2k, ..., n+rk]

where `r` is the largest integer such that `n`+`rk` <= `m`.

The expression

        begin n count c step k

constructs an array of `c` elements beginning with `n` and proceeding in increments of `k`, that is,

        [n, n+k, n+2k, ..., n+(c-1)k].

For example,

        begin 10 end 15 step 2

and

        begin 10 count 3 step 2

both construct the array:

        [10, 12, 14].

The third way to construct an array is to use the `split` function, which divides a string into array elements at whitespace. Quoted elements keep embedded whitespace and strip the quotes upon placement into the array. For example, on UNIX machines:

        split(‘ls‘)

returns an array of the files in the current directory.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO GridServer®

Copyright © 2001-2022. TIBCO Software Inc. All Rights Reserved.