
![]() |
Show Changes |
![]() |
|
![]() |
Recent Changes |
![]() |
Subscriptions |
![]() |
Lost and Found |
![]() |
Find References |
![]() |
Rename |
![]() |
Administration Page |
| Search |
History
| 9/10/2007 1:23:37 PM |
| -74.12.249.23 |
| 9/10/2007 1:22:41 PM |
| -74.12.249.23 |
| 9/10/2007 1:21:39 PM |
| -74.12.249.23 |
| 9/10/2007 1:20:16 PM |
| -74.12.249.23 |
| 9/10/2007 1:19:29 PM |
| -74.12.249.23 |
![]() |
List all versions |
Related Topics
The Array type has the following members:
| Array Append(Array array) |
| Answer this array after the supplied array has been appended on the end. |
| Array Collect(Block block) |
| Evalute the given block once for each object in the array; answer a new array containing the result of each block evaluation. |
| Integer Count |
| Answer the number of objects in the array |
| Object IsEmpty |
| Answer true if this object is empty, else false |
| Object Item(Integer index) |
| Answer the item at the given index |
| Array Reverse |
| Answer a new array that is in reverse order of the original array |
| Array ReverseSort |
| Sort the array; answer a new array (that is sorted) |
| Array ReverseSortBy(Block block) |
| Sort the array; evaluate the block for each object in the array to determine the object used to order that item in the sort |
| Array Select(Block block) |
| Evaluate the block for each item in the array; answer a new Array that includes on those objects for which the block evaluated to true. |
| Array Snip(Integer maxCount) |
| Answer a new array that is a copy of this array, but trimmed to have no more than the given number of objects. |
| Array Sort |
| Sort the array; answer a new array (that is sorted) |
| Array SortBy(Block block) |
| Sort the array; evaluate the block for each object in the array to determine the object used to order that item in the sort |
| String ToOneString |
| Answer a single string that is the concatenation of all of the objects in the array converted to strings |
| Object ToPresentation |
| Convert this object to a Presentation |
| Array Unique |
| Answer the unique elements in this array |
[1,2,3].Append([4,5,6]).Collect{each | [" *", each, Newline]}
[1,2,3].Item(0)1
[2,1,3].Sort123
["a", "c", "d", "b", "b"].Sortabbcd
[1,2,3].Count3
[1,2,3].ToOneString123
[1,2,[4,3,2,1]].Item(2).Count4
Apply the block parameter to each element in the array and return a new array. Collect is a method which is very functional programming-like in nature. Think of it working a bit like foreach in C# or VB.
["a","aa","aaa"].Collect{each | each.Length}
123
Sort "one", "two", "three", "four", "five" according to the length of each string:
["one", "two", "three", "four", "five"].SortBy{each | each.Length}.Collect{each | [each, Newline]}.ToOneString
two
one
four
five
three
Notice that SortBy is not a StableSort.
[1,2,3].Append([2,3,4,5,6]).Unique.Collect{each | [" *", each, Newline]}
:SelectCategoryTopics:{ keyword |
namespace.Topics.Select{ each |
each.HasProperty("Category") }.Select{ each |
each.GetProperty("Category").Contains(keyword) }.Collect{ each | each }
}
TestJwd.ArrayDemo(3:1) : Expected right parenthesis ')' or comma ','; got TokenEndOfInput
[ Page1Keyword1, Page2Keyword1, [ Page3Keyword1, Page3Keyword2 ], Page4Keyword1 ].UNION.Unique.Collect{each | [each, Newline]}.ToOneString
-- MichaelStamenov [7/22/2005]
Is MichaelStamenov right? -- JamesRoeSmith.
TestJwd.ArrayDemo(1:21) : No such property or function: Array.Union