HomePage HomePage
JW Davidson JW Davidson

RSS feed for the TestJwd namespace

Show Changes Show Changes
Edit Edit
Print Print
Recent Changes Recent Changes
Subscriptions Subscriptions
Lost and Found Lost and Found
Find References Find References
Local Search

History

9/12/2007 3:42:33 PM
-10.10.192.22
9/12/2007 3:41:12 PM
-10.10.192.22
9/12/2007 3:39:52 PM
-10.10.192.22
9/12/2007 3:39:06 PM
-10.10.192.22
9/12/2007 3:35:51 PM
-10.10.192.22
List all versions List all versions
Wiki Talk Function
.
Summary

Basic Definition

A function has three things:

  1. A name
  2. Zero or more parameters
  3. A list of strings to output

Syntax

WikiTalk uses the FlexWikiParameters feature to allow the creation of functions.

ExampleFunction
Usage

Note: It is apparently very important that there is no space between the ':' and the '{' after the parameter name.

Question
 :TwoColumnRow:{ parameterOne, parameterTwo |
        [ "||{!}" , parameterOne , ":||", parameterTwo , "||" ]
 }
 @@TwoColumnRow("Header","Item1")@@
 @@TwoColumnRow("Header","Item2")@@
 @@TwoColumnRow("Header","Item3")@@


split into different @@ blocks

Header: Item1
Header: Item2
Header: Item3

in the same @@ block

Header: Item1
Header: Item2
Header: Item3

Here's a sample I agonized over for a while, scraped from _NormalBorders: (Wes Williamson - 2005/02/01)

MSN MSN
Google Google
Google Google
Google Google
Google Google
 @@[LinkItem("Go to Google","MSN","http://msn.com"),
    LinkItem("Go to Google","Google","http://google.com"),
    LinkItem("Go to Google","Google","http://google.com"),
    LinkItem("Go to Google","Google","http://google.com"),
    LinkItem("Go to Google","Google","http://google.com")]@@

 

OneParamExample
Header
NoParamExample
Fixed Text

I (BarryKelly) have struggled to get a looping construct to work. In the absence of variables, I've used recursive functions in a similar way to a functional language. For example:

 :CountUpTo:{
   n | 
     n.Equals(0)
       .IfTrue { "" }
       IfFalse { [ CountUpTo(n.Subtract(1)), Tab, "* ", n.ToString, Newline ] }
 }
 @@CountUpTo(10)@@

Gives:

You must be careful not to cause an infinte loop, or you'll need to restart aspnet_wp or w3wp on the web server.

Question
Has the WikiTalkFunction ever returned something different from list of strings?

Not logged in. Log in

The wiki for all things Objective Design Solutions

Recent Topics
WikiTalkFunction WikiTalkFunction
List all versions List all versions
Go to Google.com
Change Style
Powered by Flexwiki v2.0.0.218