Show Changes Show Changes
Print Print
Recent Changes Recent Changes
Subscriptions Subscriptions
Lost and Found Lost and Found
Find References Find References
Rename Rename
Administration Page Administration Page
Search

History

1/24/2008 9:10:56 AM
FLWCOM-jwdavidson
10/4/2007 5:58:42 PM
-68.153.117.50
1/5/2007 1:21:19 PM
-137.99.65.235
1/5/2007 1:20:40 PM
-137.99.65.235
10/13/2005 5:05:48 AM
-195.149.58.195
List all versions List all versions

RSS feed for the FlexWiki namespace

Wiki Talk Looping Demo
.
See_also

Using functions and loops to construct a table from two arrays

 :Cell: {r,c| [r, c]}
 :Row: {r, cs| [ cs.Collect{c| ["||", Cell(r, c)]}, "||", Newline]}
 :Table: {rs, cs| rs.Collect{r|Row(r, cs)}}
 @ @ Table(["A", "B", "C", "D"], [1,2,3,4,5,6]) @ @
A1 A2 A3 A4 A5 A6
B1 B2 B3 B4 B5 B6
C1 C2 C3 C4 C5 C6
D1 D2 D3 D4 D5 D6

Loop through a static list of ages

This example converts a static list of numbers into an array, then loops through the array searching for topics that have an age equal to the number.

 @@["21", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40"].Collect
 { n | ["|| ", n, "|| ", namespace.TopicsWith("Age", n).Collect{e | e.Name}, "|| ", Newline]}
 @@

Outputs...

30 JamesBerry ,
31
32
33
34 KorbyParnell ,
35 DanielBruessler , TopicPropertyTable ,
36 DarenMay , PeterProvost ,
37
38
39
40

Advanced examples of looping through collected values

Example code for looping through topics searching for those with a property called "Age":

 @@namespace.Topics.Collect
 { e |
 e.HasProperty("Age").
         IfTrue {["||[", e.Name, "]||", e.GetProperty("Name"), "||", e.GetProperty("Age"), "||", Newline]}
         IfFalse { "" }
 }
 @@

Outputs...

DanielBruessler Daniel 35
DarenMay Daren May 36
JamesBerry James 30
KorbyParnell Korby 34
PeterProvost Peter Provost 36
TopicPropertyTable 35
WardCunningham Ward Aquarius
WikiTalkLoopingDemo Bob 42

Example code for that uses the Select method on Topics to find topics with an "Age" property:

 @@namespace.Topics.
         Select { e | e.HasProperty("Age")}.
         Collect {e | ["||[", e.Name, "]||", e.GetProperty("Name"), "||", e.GetProperty("Age"), "||", Newline]}
 @@
DanielBruessler Daniel 35
DarenMay Daren May 36
JamesBerry James 30
KorbyParnell Korby 34
PeterProvost Peter Provost 36
TopicPropertyTable 35
WardCunningham Ward Aquarius
WikiTalkLoopingDemo Bob 42
Name
Age

Make a link named "link" to topics with a property called "RightBorder"

 @@[
   namespace.TopicsWith("RightBorder")
   .Collect
      { e | [
         "||", 
            "\"link\":[", e.Name, "]",
         "||",
            e.Name,
         "||",
            e.Summary,
         "||", Newline,
      ]}

]

 @@
link ClusteringResultsBorders A border element that displays the similar topics, based on automatic clustering. See: TextMiningProject
link FileLockingImplementation describes the implementation of File Locking in TopicLocks.aspx
link HomePageBorders
link LarryBorders
link NormalBordersJwd
link NormalBordersRightOnlyWithUpload2 Right border, Bottom Border, upload link, recent topics, and changes. Save this over _NormalBorders.wiki. Uses WikiUploadPageScript upload method
link PlayBorders Some test borders for the test page.
link SolidReleaseProjectRecruitingBorders
link _NormalBorders
link _WikiTalkBorders
Not logged in. Log in

Welcome to the home of FlexWiki, an experimental collaboration tool, based on WikiWiki.

This is FlexWiki, an open source wiki engine.

This site supports the new NoFollow anti-spam initiative.
Change Style

Recent Topics