[var anc.text "Key-Val/If Blocks/Loops [alt]Math [alt]Alts and alt parameters [alt]Conditional Statements [alt]Upper/Lower Casify [alt]Pass In Variables [alt]Complex Examples [alt]Dynamic Variable Setting [alt]References [alt]Recursive Protection Test [alt]Form Element passing / Hidden values / Error values [alt]Wrap/Content Loading and Overriding [alt]Site Properties [alt]Cookies [alt]Literals [alt]Short Usernames [alt]Subroutine Calls [alt]Variable Lookup [alt]Encoding [alt]Regex [alt]Sprintf [alt]NoWrap [alt]ISML [alt]Graph "] [loop n [.. 1 anc.text.length] "[push anc.name [sprintf 'a%02d' pass.n]]"] [loop n [.. 1 anc.text.length] "[pass.n]. [anc.text]
[env.nl]"]

# Key-Val/If Blocks/Loops

[var o.iter [.. 0 10 3]] [var o.str "([pass._] , [o.iter])"] [var o.a "A"] [var o.b "B"]

    [var o.iter [.. 0 10 3]]
    [var o.str "([pass._] , [o.iter])"]
    [var o.a "A"]
    [var o.b "B"]

Code | Produces | Should Look Like
--- | --- | ---
[join "~" [keys o]] | [join "~" [keys o]] | iter~a~b~str
[join "~" [values o]] | [join "~" [values o]] | ARRAY(0xSOMETHINGRANDOM)~A~B~([pass._])
[join "~" [sort keys o]] | [join "~" [sort keys o]] | a~b~iter~str
[join "~" [keys o.iter] | [join "~" [keys o.iter]] | 1~2~3~4
[join "~" [values o.iter]] | [join "~" [values o.iter]] | 0~3~6~9
[join "~" [keys o.a]] | [join "~" [keys o.a]] | 1
[join "~" [values o.a]] | [join "~" [values o.a]] | A
Code | Produces | Should Look Like
[if o.a.length [loop o.a.length o.a] "No Length"] | [if o.a.length [loop o.a.length o.a] "No Length"] | A
[if o.c.length [loop o.c.length o.c] "No Length"] | [if o.c.length [loop o.c.length o.c] "No Length"] | No Length
[if o.c.length [loop o.c.length o.c] elsif o.d.length [loop o.d.length o.d] elsif o.b.length [loop o.b.length o.b] else "No Length"] | [if o.c.length [loop o.c.length o.c] elsif o.d.length [loop o.d.length o.d] elsif o.b.length [loop o.b.length o.b] else "No Length"] | B
[if o.c.length [loop o.c.length o.c] else "No Length"] | [if o.c.length [loop o.c.length o.c] else "No Length"] | No Length
[if ! o.a "o.a is not set"] | [if ! o.a "o.a is not set"] |
[if ! o.c "o.c is not set"] | [if ! o.c "o.c is not set"] | o.c is not set
Code | Produces | Should Look Like
[var o.strn "([pass.n])"] | [var o.strn "([pass.n])"] |
[var o.strm "([pass.n],[pass.m])"] | [var o.strm "([pass.n],[pass.m])"] |
[var o.iter.alt 2] | [var o.iter.alt 2] |
[loop [.. 1 10 2] o.str] | [loop [.. 1 10 2] o.str] | (1 , 3)(3 , 6)(5 , 9)(7 , 0)(9 , 3)
[loop foo [.. 1 10 2] "([pass.foo]-[pass.foo])"] | [loop foo [.. 1 10 2] "([pass.foo]-[pass.foo])"] | (1-1)(3-3)(5-5)(7-7)(9-9)
[var o.iter.alt 1] | [var o.iter.alt 2] |
[loop [values o.iter] o.str] | [loop [values o.iter] o.str] | (0 , 3)(3 , 6)(6 , 9)(9 , 0)
[loop n [values o.iter] "[if [== pass.n 6] [next]][o.strn]"] | [loop n [values o.iter] "[if [== pass.n 6] [next]][o.strn]"] | (0)(3)(9)
[loop n [values o.iter] "[if [== pass.n 6] [last]][o.strn]"] | [loop n [values o.iter] "[if [== pass.n 6] [last]][o.strn]"] | (0)(3)
[loop n [values o.iter] "[if [== pass.n 6] [last 1]][o.strn]"] | [loop n [values o.iter] "[if [== pass.n 6] [last 1]][o.strn]"] | (0)(3)(6)
[loop n [values o.iter] ' [loop m [values o.iter] " [if [== pass.m 3] [last m 1] elsif [== pass.n 3] [last n 1] ][o.strm]"]<br>'] | [loop n [values o.iter] '[ loop m [values o.iter] "[ if [== pass.m 3] [last m 1] elsif [== pass.n 3] [last n 1] ][o.strm]"] '] | (0,0)(0,3) (3,0)(3,3)
[loop n [values o.iter] ' [loop m [values o.iter] " [if [== pass.m 3] [last n 1]] [o.strm]"]<br>'] | [loop n [values o.iter] '[ loop m [values o.iter] "[ if [== pass.m 3] [last n 1] ][o.strm]"] '] | (0,0)(0,3)(0,6)(0,9)
[loop n [values o.iter] ' [loop m [values o.iter] " [if [< pass.m 6] [next m] elsif [< pass.n 6] [next n]] [o.strm]"]<br>'] | [loop n [values o.iter] '[ loop m [values o.iter] "[ if [< pass.m 6] [next m] elsif [< pass.n 6] [next n] ][o.strm]"] '] | (6,6)(6,9) (9,6)(9,9)

# Math

[var n.bar0 0] [var n.bar2 2] [var n.bar3 3] [var n.str "Hello"] [var n.true 1] [var n.false ""] [var n.a 3]

    [var n.bar0 0]
    [var n.bar2 2]
    [var n.bar3 3]
    [var n.str "Hello"]
    [var n.true 1]
    [var n.false ""]
    [var n.a 3]

Code | Produces | Should Look Like
--- | --- | ---
[+ 1 2 [n.bar2]] | [+ 1 2 [n.bar2]] | 5
[var n.bar9 [* n.bar3 n.bar3]] | [var n.bar9 [* n.bar3 n.bar3]] |
[n.bar9] | [n.bar9] | 9
[- n.bar9 2] | [- n.bar9 2] | 7
[- n.bar9 2 1] | [- n.bar9 2 1] | 6
[* 1 2 [n.bar2]] | [* 1 2 [n.bar2]] | 4
[/ n.bar9 2] | [/ n.bar9 2] | 4.5
[% n.bar9 5] | [% n.bar9 5] | 4
[** n.bar2 n.bar3] | [** n.bar2 n.bar3] | 8
[&& n.bar0 n.str] | [&& n.bar0 n.str] | 0
[&& n.str n.bar2] | [&& n.str n.bar2] | 1
[&& ! n.bar0 n.str] | [&& ! n.bar0 n.str] | 1
[&& ! n.bar0 ! n.str] | [&& ! n.bar0 ! n.str] | 0
[&& n.bar2 n.bar3 n.str] | [&& n.bar2 n.bar3 n.str] | 1
[|| n.bar0 n.str] | [|| n.bar0 n.str] | Hello
[|| n.barz n.str] | [|| n.barz n.str] | Hello
[== 1 n.true] | [== 1 n.true] | 1
[!= 1 n.true] | [!= 1 n.true] | 0
[!= 0 n.true] | [!= 0 n.true] | 1
[< 0 n.a] | [< 0 n.a] | 1
[> 0 n.a] | [> 0 n.a] | 0
[> 0 n.false] | [> 0 n.false] | 0
[> "boo" "bad"] | [> "boo" "bad"] | 0
[== "" n.true] | [== "" n.true] | 0
[== 0 n.true] | [== 0 n.true] | 0
[== 0 n.false] | [== 0 n.false] | 1
[&& [< 0 n.a] [<= n.a n.bar3]] | [&& [< 0 n.a] [<= n.a n.bar3]] | 1
[join env.nbsp [.. 1 20 3]] | [join env.nbsp [.. 1 20 3]] | 1 4 7 10 13 16 19
[join env.nbsp [.. -3 -5 .34]] | [join env.nbsp [.. -3 -5 .34]] | -3 -3.34 -3.68 -4.02 -4.36 -4.7
[random 4 6] | [random 4 6] | N/A (an integer between 4 and 6)

# Alts and alt parameters

(In wrap files multiple values should be separated by [alt] tags) [var a.A ""] [var a.B "0"] [var a.a "String"] [var a.b "A[alt]B[alt]C[alt]D[alt]E"] [var a.c "5"] [var a.d "1[alt]2[alt]3[alt]4[alt]5"]

    [var a.A ""]
    [var a.B "0"]
    [var a.a "String"]
    [var a.b "A[alt]B[alt]C[alt]D[alt]E"]
    [var a.c "5"]
    [var a.d "1[alt]2[alt]3[alt]4[alt]5"]

Code | Produces | Should Look Like
--- | --- | ---
[a.A.length] | [a.A.length] | 0
[a.B.length] | [a.B.length] | 1
[a.C.length] | [a.C.length] | 0
[a.a.length] | [a.a.length] | 1
[a.b.length] | [a.b.length] | 5
[a.b] | [a.b] | A
[a.b.alt] | [a.b.alt] | 2
[var a.b.alt 3] | [var a.b.alt 3] |
[a.b.alt] | [a.b.alt] | 3
[a.b] [a.b.2] [a.b] | [a.b] [a.b.2] [a.b] | C B D
[ var a.b.alt 1 ] | [ var a.b.alt 1 ] |
[join "~~" [values a.b]] | [join "~~" [values a.b]] | A~~B~~C~~D~~E
[join "[a.d]" [values a.b]] | [join "[a.d]" [values a.b]] | A1B2C3D4E
[join a.d [values a.b]] | [join a.d [values a.b]] | A5B5C5D5E
[ var a.b.alt 5 ] | [ var a.b.alt 5 ] |
[a.b.alt] | [a.b.alt] | 5
[a.b.0] [a.b.0] | [a.b.0] [a.b.0] | D D
[ var a.b.alt 1 ] | [ var a.b.alt 1 ] |
[a.b.0] [a.b.0] | [a.b.0] [a.b.0] | E E
[loop [/ a.b.length 2] a.b] | [loop [/ a.b.length 2] a.b] | AB
[loop [* 1 3] a.b] | [loop [* 1 3] a.b] | CDE
[loop a.b.length a.b] | [loop a.b.length a.b] | ABCDE
[loop a.c a.b] | [loop a.c a.b] | ABCDE
[loop 3 a.b ] | [loop 3 a.b] | ABC
[loop [- [+ 3 2] 1] a.b] | [loop [- [+ 3 2] 1] a.b] | DEAB
[loop [ 5 3] a.b] | [loop [% 5 3] a.b] | CD
[loop [.. 3 1] "]pass._][a.b]"] | [loop [.. 3 1] "[pass._][a.b]"] | 3E2A1B
[loop [- a.b.length 2] "wow ([a.b])<br>[env.nl]"] | [loop [- a.b.length 2] "wow ([a.b]) [env.nl]"] | wow (C) wow (D) wow (E)
[ a.a.random ] | [ a.a.random ] | String
[ a.b.random ] | [ a.b.random ] | N/A
[push a.b "F[alt]G"] | [push a.b "F[alt]G"] |
[ var a.b.alt 1 ] | [ var a.b.alt 1 ] |
[join "~~" [values a.b]] | [join "~~" [values a.b]] | A~~B~~C~~D~~E~~F~~G

# Conditional Statements

[var b.true "1"] [var b.false ""] [var b.a 3]

    [var b.true  "1"]
    [var b.false ""]
    [var b.a  3]

Code | Produces | Should Look Like
--- | --- | ---
[b.b?"TRUE":"FALSE"] | [b.b?"TRUE":"FALSE"] | FALSE
[b.true?"TRUE":"FALSE"] | [b.true?"TRUE":"FALSE"] | TRUE
[ ! b.true ? "TRUE" : "FALSE" ] | [ ! b.true ? "TRUE" : "FALSE" ] | FALSE
[ b.false ? "TRUE" : "FALSE" ] | [ b.false ? "TRUE" : "FALSE" ] | FALSE
[ b.true ? : "FALSE" ] | [ b.true ? : "FALSE" ] |
[ b.false ? "TRUE" : ] | [ b.false ? "TRUE" : ] |
[ b.true ? b.true ? 'A' : b.true ? 'B' : 'C' : 'D' ] | [ b.true ? b.true ? 'A' : b.true ? 'B' : 'C' : 'D' ] | A
[b.true?b.true?'A':b.true?'B':'C':'D'] | [b.true?b.true?'A':b.true?'B':'C':'D'] | A
[b.true?b.false?'A':b.true?'B':'C':'D'] | [b.true?b.false?'A':b.true?'B':'C':'D'] | B
[b.true?b.false?'A':b.false?'B':'C':'D'] | [b.true?b.false?'A':b.false?'B':'C':'D'] | C
[b.false?b.true?'A':b.true?'B':'C':'D'] | [b.false ?b.true?'A':b.true?'B':'C':'D'] | D
[ [>= browser.ie 5] ? "TRUE" : "FALSE" ] | [ [>= browser.ie 5] ? "TRUE" : "FALSE" ] | N/A
[ [>= browser.ie 6] ? "TRUE" : "FALSE" ] | [ [>= browser.ie 6] ? "TRUE" : "FALSE" ] | N/A
[ [>= browser.nn 1] ? "TRUE" : "FALSE" ] | [ [>= browser.nn 1] ? "TRUE" : "FALSE" ] | N/A
[ browser.ie ] | [ browser.ie ] | N/A
[ browser.nn ] | [ browser.nn ] | N/A
[ browser.ua ] | [ browser.ua ] | N/A
[if [eq "1" b.true] "TRUE" "FALSE" ] | [if [eq "1" b.true] "TRUE" "FALSE" ] | TRUE
[if [eq 1 b.true] "TRUE" "FALSE"] | [if [eq 1 b.true] "TRUE" "FALSE" ] | TRUE
[ [== 1 b.true] ? "TRUE" : "FALSE" ] | [ [== 1 b.true] ? "TRUE" : "FALSE" ] | TRUE
[ [ne 1 b.true] ? "TRUE" : "FALSE" ] | [ [ne 1 b.true] ? "TRUE" : "FALSE" ] | FALSE
[ [!= 1 b.true] ? "TRUE" : "FALSE" ] | [ [!= 1 b.true] ? "TRUE" : "FALSE" ] | FALSE
[ [ne 0 b.false] ? "TRUE" : "FALSE" ] | [ [ne 0 b.false] ? "TRUE" : "FALSE" ] | TRUE
[ [!= 0 b.false] ? "TRUE" : "FALSE" ] | [ [!= 0 b.false] ? "TRUE" : "FALSE" ] | FALSE
[ [< 0 b.a] ? "TRUE" : "FALSE" ] | [ [< 0 b.a] ? "TRUE" : "FALSE" ] | TRUE
[ [> 0 b.a] ? "TRUE" : "FALSE" ] | [ [> 0 b.a] ? "TRUE" : "FALSE" ] | FALSE
[ [> 0 b.false] ? "TRUE" : "FALSE" ] | [ [> 0 b.false] ? "TRUE" : "FALSE" ] | FALSE
[ [gt 0 b.a] ? "TRUE" : "FALSE" ] | [ [gt 0 b.a] ? "TRUE" : "FALSE" ] | FALSE
[ [lt 0 b.a] ? "TRUE" : "FALSE" ] | [ [lt 0 b.a] ? "TRUE" : "FALSE" ] | TRUE
[ [> "boo" "bad"] ? "TRUE" : "FALSE" ] | [ [> "boo" "bad"] ? "TRUE" : "FALSE" ] | FALSE
[ [gt "boo" "bad"] ? "TRUE" : "FALSE" ] | [ [gt "boo" "bad"] ? "TRUE" : "FALSE" ] | TRUE
[if [eq "" b.true] "TRUE" "FALSE" ] | [if [eq "" b.true] "TRUE" "FALSE" ] | FALSE
[if [eq 0 b.true] "TRUE" "FALSE" ] | [if [eq 0 b.true] "TRUE" "FALSE" ] | FALSE
[ [== "" b.true] ? "TRUE" : "FALSE" ] | [ [== "" b.true] ? "TRUE" : "FALSE" ] | FALSE
[ [== 0 b.true] ? "TRUE" : "FALSE" ] | [ [== 0 b.true] ? "TRUE" : "FALSE" ] | FALSE
[if [ne "1" b.true] "TRUE" "FALSE" ] | [if [ne "1" b.true] "TRUE" "FALSE" ] | FALSE

# Upper/Lower Casify

[var c.txt "THIS is SOME text"]

    [var c.txt "THIS is SOME text"]

Code | Produces | Should Look Like
--- | --- | ---
[uc c.txt] | [uc c.txt] | THIS IS SOME TEXT
[ uc c.txt ] | [ uc c.txt ] | THIS IS SOME TEXT
[ lc c.txt ] | [ lc c.txt ] | this is some text
[ ic c.txt ] | [ ic c.txt ] | This Is Some Text
[ uc "my BIT o TEXT" ] | [ uc "my BIT o TEXT" ] | MY BIT O TEXT
[ lc "my BIT o TEXT" ] | [ lc "my BIT o TEXT" ] | my bit o text
[ ic "my BIT o TEXT" ] | [ ic "my BIT o TEXT" ] | My Bit O Text

# Pass In Variables

[var d.txt "spot1([pass.spot1]) spot2([pass.spot2])"] [var d.a "AAAA"] [var d.b "BBBB"] [var d.c "1111[alt]2222[alt]3333"]

    [var d.txt "spot1([pass.spot1]) spot2([pass.spot2])"]
    [var d.a "AAAA"]
    [var d.b "BBBB"]
    [var d.c "1111[alt]2222[alt]3333"]

Code | Produces | Should Look Like
--- | --- | ---
[d.txt;spot1=d.a;spot2=d.b] | [d.txt;spot1=d.a;spot2=d.b] | spot1(AAAA) spot2(BBBB)
[ d.txt ; spot1 = d.a ; spot2 = d.b ] | [ d.txt ; spot1 = d.a ; spot2 = d.b ] | spot1(AAAA) spot2(BBBB)
[ d.txt ; spot1 = "My Text" ; spot2 = "My Text2" ; ] | [ d.txt ; spot1 = "My Text" ; spot2 = "My Text2" ; ] | spot1(My Text) spot2(My Text2)
[ d.txt ; spot1 = d.c ; spot2 = d.c ] | [ d.txt ; spot1 = d.c ; spot2 = d.c ] | spot1(1111) spot2(2222)
[ d.txt ; spot1 = d.c ; spot2 = d.c.0 ] | [ d.txt ; spot1 = d.c ; spot2 = d.c.0 ] | spot1(3333) spot2(3333)
[ d.txt ;; spot1 = "Some text; including semicolons (;)" ;; spot2 = "Notice that a double semicolon is the delimiter" ;; ] | [d.txt ;; spot1 = "Some text; including semicolons (;)" ;; spot2 = "Notice that a double semicolon is the delimiter" ;; ] | spot1(Some text; including semicolons (;)) spot2(Notice that a double semicolon is the delimiter)

# Complex Examples

[var e.txt "spot1([pass.spot1])"] [var e.a "AAAA"] [var e.href "[pass.h_text]"] [var e.link "%5B pass.url ? e.href;h_url=pass.url;h_text=pass.text; : 'No link passed' %5D"]

    [var e.txt "spot1([pass.spot1])"]
    [var e.a "AAAA"]
    [var e.href "<a href='[pass.h_url]'>[pass.h_text]</a>"]
    [var e.link "%5B pass.url ? e.href;h_url=pass.url;h_text=pass.text; : 'No link passed' %5D"]

Code | Produces | Should Look Like
--- | --- | ---
[ e.a ? e.txt;spot1='Passed'; : 'e.a is not set' ] | [ e.a ? e.txt;spot1='Passed'; : 'e.a is not set' ] | spot1(Passed]
[ e.b ? e.txt;spot1='Passed'; : 'e.b is not set' ] | [ e.b ? e.txt;spot1='Passed'; : 'e.b is not set' ] | e.b is not set
[ e.a ? 'e.a is set' : e.txt;spot1='Passed'; ] | [ e.a ? 'e.a is set' : e.txt;spot1=e.a ] | e.a is set
[ e.b ? 'e.b is set' : e.txt;spot1='Passed'; ] | [ e.b ? 'e.b is set' : e.txt;spot1='Passed'; ] | spot1(Passed)
[ e.link;url="http://somewhere.com/";text="Somewhere.com"; ] | [ e.link;url="http://somewhere.com/";text="Somewhere.com"; ] | Somewhere.com
[ e.link;url="";text="Somewhere.com"; ] | [ e.link;url="";text="Somewhere.com"; ] | No link passed

# Dynamic Variable Setting

[var f.a "Some Text of Mine"] [var f.c "aa[alt]bb[alt]cc"]

    [var f.a "Some Text of Mine"]
    [var f.c "aa[alt]bb[alt]cc"]

Code | Produces | Should Look Like
--- | --- | ---
[ var f.b = "" ] | [ var f.b = "" ] |
[f.b] | [f.b] |
[ var f.b = uc f.a] | [ var f.b = uc f.a] |
[f.b] | [f.b] | SOME TEXT OF MINE
[ var f.b = "Some Other Text" ] | [ var f.b = "Some Other Text" ] |
[f.b] | [f.b] | Some Other Text
[ var f.b = loop f.c.length f.c ] | [ var f.b = loop f.c.length f.c ] |
[f.b] | [f.b] | aabbcc
[ var f.b = uc f.b ] | [ var f.b = uc f.b ] |
[f.b] | [f.b] | AABBCC

# References

[var f.a "Some Text of Mine"] [var f.c "aa[alt]bb[alt]cc"]

    [var f.a "Some Text of Mine"]
    [var f.c "aa[alt]bb[alt]cc"]

Code | Produces | Should Look Like
--- | --- | ---
[ var ff references F ] | [ var ff references F ] | [Area "F" is not defined]
[ var ff references f ] | [ var ff references f ] |
[ var f.d references f.c ] | [ var f.d references f.c ] |
[ loop f.c.lengthf.c ] | [ loop f.c.length f.c ] | aabbcc
[ loop f.c.lengthf.d ] | [ loop f.c.length f.d ] | aabbcc
[ loop f.c.lengthff.d ] | [ loop f.c.length ff.d ] | aabbcc
[ var f.c.alt 1 ] | [ var f.c.alt 1 ] |
[ var f.d.alt 2 ] | [ var f.d.alt 2 ] |
[ var ff.d.alt 3 ] | [ var ff.d.alt 3 ] |
[ loop f.c.length f.c ] | [ loop f.c.length f.c ] | aabbcc
[ loop f.d.length f.d ] | [ loop f.d.length f.d ] | bbccaa
[ loop ff.d.length ff.d ] | [ loop ff.d.length ff.d ] | ccaabb
[ var f.e references f.f ] | [ var f.e references f.f ] | [[f.f] is not defined]
[ f.e ] | [ f.e ] | [ f.e ]

# Recursive Protection Test

[var g.a "([g.b])"] [var g.b "([g.c])"] [var g.c "([g.d])"] [var g.d "([g.e])"] [var g.e "([g.f])"] [var g.f "([g.g])"] [var g.g "([g.h])"] [var g.h "([g.i])"] [var g.i "([g.j])"] [var g.j "([g.k])"] [var g.k "([g.l])"] [var g.l "([g.m])"] [var g.m "([g.n])"] [var g.n "([g.o])"] [var g.o "([g.p])"] [var g.aa "([g.aa])"]

    [var g.a  "([g.b])"]
    [var g.b  "([g.c])"]
    [var g.c  "([g.d])"]
    [var g.d  "([g.e])"]
    [var g.e  "([g.f])"]
    [var g.f  "([g.g])"]
    [var g.g  "([g.h])"]
    [var g.h  "([g.i])"]
    [var g.i  "([g.j])"]
    [var g.j  "([g.k])"]
    [var g.k  "([g.l])"]
    [var g.l  "([g.m])"]
    [var g.m  "([g.n])"]
    [var g.n  "([g.o])"]
    [var g.o  "([g.p])"]
    [var g.aa "([g.aa])"]

Code | Produces | Should Look Like
--- | --- | ---
[g.a] | [g.a] | ((((((((((((((((Recursive limit (15) reached "[g.p]"))))))))))))))))
[var g.c "Hi"] | [var g.c "Hi"] |
[g.a] | [g.a] | ((Hi))
[g.aa] | [g.aa] | ((((((((((((((((Recursive limit (15) reached "[g.aa]"))))))))))))))))

[var limit.recursive 16 ] [var g.c "([g.d])"]

    [var limit.recursive 16]
    [var g.c  "([g.d])"]

Code | Produces | Should Look Like
--- | --- | ---
[g.a] | [g.a] | ((((((((((((((([g.p])))))))))))))))
[var g.c "Hi"] | [var g.c "Hi"] |
[g.a] | [g.a] | ((Hi))
[g.aa] | [g.aa] | ((((((((((((((((Recursive limit (16) reached "[g.aa]"))))))))))))))))

# Form Element passing / Hidden values / Error values

The show me cgi is has the following set up

      $FORM{test_one} = "This is \"test\" one!\n";
      $FORM{test_two} = "test_two_A[alt]test_two_B[alt]test_two_C[alt]test_two_D";
      $FORM{something_error} = "Something had an error";#
      my %FORM2 = qw(test_three test_three);
      $partner->print($FORM{page},\%FORM,\%FORM2);

Code | Produces | Should Look Like
--- | --- | ---
[form.test_one] | [form.test_one] | This is "test" one!
[form.test_two] | [form.test_two] | test_two_A
[form.test_two] | [form.test_two] | test_two_B
[form.test_three] | [form.test_three] | test_three
[henc form_hidden.test_one] | [henc form_hidden.test_one] | <input type=hidden name="test_one" value="This is &quot;test&quot; one! ">
[henc form_hidden.test_three] | [henc form_hidden.test_three] | <input type=hidden name="test_three" value="test_three">
[henc form_hidden.test_four] | [henc form_hidden.test_four] |
[form.something_error] | [form.something_error] | Something had an error
[form_error.something_error] | [form_error.something_error] | [form_error.something_error]
[form_error.test_one] | [form_error.test_one] | [form_error.test_one]

# Wrap/Content Loading and Overriding

There are two files used in this example:
my.default.partner/public/content/show_me/wrap_test.chunk
and
my.default.partner/public/wrap/show_me/wrap_test.wrap
[var all "wrap:show_me/wrap_test"] [var h.a "content:show_me/bogus.chunk"] [var h.b "content:show_me/wrap_test.chunk"] [var h.c "content:wrap_test.chunk"] [var h "content:wrap_test.chunk"] [var i "wrap:show_me/somestep/wrap_test.wrap"] [var j "wrap:show_me/wrap_test.wrap"] [var k "wrap:wrap_test.wrap"]

    [var all "wrap:show_me/wrap_test"]
    [var h.a "content:show_me/bogus.chunk"]
    [var h.b "content:show_me/wrap_test.chunk"]
    [var h.c "content:wrap_test.chunk"]
    [var h   "content:wrap_test.chunk"]
    [var i   "wrap:show_me/somestep/wrap_test.wrap"]
    [var j   "wrap:show_me/wrap_test.wrap"]
    [var k   "wrap:wrap_test.wrap"]

Code | Produces | Should Look Like
--- | --- | ---
[h.a] | [h.a] | Error: (Verbose) File "public/content/show_me/bogus.chunk" does not exist.
[h.b] | [h.b] | Begin my.default.partner/public/content/show_me/wrap_test.chunk key1 value1 from wrap_test.chunk key2 value2 from wrap_test.chunk key3 value3 from wrap_test.chunk Begin my.default.partner/public/content/show_me/wrap_test.chunk
[h.c] | [h.c] | Begin my.default.partner/public/content/show_me/wrap_test.chunk key1 value1 from wrap_test.chunk key2 value2 from wrap_test.chunk key3 value3 from wrap_test.chunk Begin my.default.partner/public/content/show_me/wrap_test.chunk
[h.key1] | [h.key1] | value1 from wrap_test.chunk
[wrap_test.key1] | [wrap_test.key2] | value2 from wrap_test.wrap
[i.key2] | [i.key2] | value2 from wrap_test.wrap
[j.key2] | [j.key2] | value2 from wrap_test.wrap
[k.key2] | [k.key2] | [k.key2] (the file public/wrap/wrap_test.wrap doesn't exist)

# Site Properties

Code | Produces | Should Look Like
--- | --- | ---
[site.banners] | [site.banners] | N/A
[site.email] | [site.email] | N/A
[site.name] | [site.name] | N/A
[site.quota] | [site.quota] | N/A
[site.file_size] | [site.file_size] | N/A
[site.site] | [site.site] | N/A
[site.webmaster_gender] | [site.webmaster_gender] | N/A

# Cookies

Code | Produces | Should Look Like
--- | --- | ---
[cookie.blah] | [cookie.blah] | some long value

# Literals

    [var big.thing literal "'"'''"'"this's weird text' ]

[var big.thing literal "'"'''"'"this's weird text' ]

Code | Produces | Should Look Like
--- | --- | ---
[big.thing] | [big.thing] | "'"'''"'"this's weird text'

# Short Usernames

    [var preferences.allow_short_username 'foo.com']
    [var site.site 'subsubdomain.subdomain.foo.com']

[var preferences.allow_short_username 'foo.com'] [var site.site 'subsubdomain.subdomain.foo.com']

Code | Produces | Should Look Like
--- | --- | ---
[site.username] | [site.username] | subsubdomain.subdomain

# Subroutine Calls

The wrap test has the following set up inside:

    $FORM{print_whatever} = sub { "You gave me...
    ". &O::Is::is_dump(\@_) };

    [var a.a "Something"]

[var a.a "Something"]

Code | Produces | Should Look Like
--- | --- | ---
[sub print_whatever "foo" a.a "bar"] | [sub print_whatever "foo" a.a "bar"] | You gave me... VAR = [ "foo", "Something", "bar" ];
[sub print_whatever] | [sub print_whatever] | You gave me... VAR = [ "" ];
[sub print_bogus "foo"] | [sub print_bogus "foo"] | [Item "print_bogus" is not a subroutine]
[sub isun b] | [sub isun b] | (doesn't show anything here, but the isun will appear at the top)

# Variable Lookup

[var j.a "elite"] [var j.elite "HURRAH"] [var j.b [j.[j.a]]] [var j.c "ONE[alt]TWO[alt]THREE"] [var j.d "c"] [var j.e "2"]

    [var j.a "elite"]
    [var j.elite "HURRAH"]
    [var j.b [j.[j.a]]]
    [var j.c "ONE[alt]TWO[alt]THREE"]
    [var j.d "c"]
    [var j.e "2"]

Code | Produces | Should Look Like
--- | --- | ---
[j.b] | [j.b] | HURRAH
[j.[j.a]] | [j.[j.a]] | HURRAH
[j.c.[j.e]] | [j.c.[j.e]] | TWO
[j.[j.d].[+2 1]] | [j.[j.d].[+ 2 1]] | THREE

# Encoding

[var k.thing literal "hi' %4#@ "]

    [var k.thing literal <tag>"hi'
      %4#@
    "]

Code | Produces | Should Look Like
--- | --- | ---
[henc k.thing] | [henc k.thing] | <tag>"hi' %4#@ "
[uenc k.thing] | [uenc k.thing] | %3Ctag%3E%22hi%27%0A++%254%23%40%0A%22

# Regex

[var m.a "ABc DeF GHIabC"] [var m.A "foo[alt]bar[alt]baz"] [var m.str "Error"]

    [var m.a "ABc DeF GHIabC"]
    [var m.A "foo[alt]bar[alt]baz"]
    [var m.str "Error"]

Code | Produces | Should Look Like
--- | --- | ---
[var m.c regex "m%a(..)%" m.a] [join "-" [values m.c]] | [var m.c regex "m%a(..)%" m.a][join "-" [values m.c]] | bC
[var m.c regex "m%(.a.)%" [values m.A]] [join "-" [values m.c]] | [var m.c regex "m%(.a.)%" [values m.A]] [join "-" [values m.c]] | bar-baz
[var m.c regex "m/a(..)/ig" m.a] [join "-" [values m.c]] | [var m.c regex "m/a(..)/ig" m.a] [join "-" [values m.c]] | Bc-bC
[loop [values regex._] "([pass._])"] | [ loop [values regex._] "([pass._])"] | (Bc)(bC)
[regex._.1] | [ regex._.1] | Bc
[regex._.2] | [ regex._.2] | bC
[var m.c regex "m/a../ig" m.a] [join "-" [values m.c]] | [var m.c regex "m/a../ig" m.a] [join "-" [values m.c]] | ABc-abC
[regex "m/(a.+?h)/i" m.a] | [regex "m/(a.+?h)/i" m.a] | ABc DeF GH
[regex "m/(a)/ig" m.a] | [regex "m/(a)/ig" m.a] | (Don't do this - unless setting, only match one var)
[[regex "m/a/" m.a] ? "YES" : "NO"] | [[regex "m/a/" m.a] ? "YES" : "NO"] | YES
[[regex m.a m/p/] ? "YES" : "NO"] | [[regex "m/p/" m.a] ? "YES" : "NO"] | NO
[var m.c regex "s/a(..)/($1)/ig" m.a] [join "-" [values m.c]] | [var m.c regex "s/a(..)/($1)/ig" m.a] [join "-" [values m.c]] | (Bc) DeF GHI(bC)
[var m.c regex "s/(.)a(.)/($1)a($2)/ig" [values m.A]] [join "-" [values m.c]] | [var m.c regex "s/(.)a(.)/($1)a($2)/ig" [values m.A]] [join "-" [values m.c]] | foo-(b)a(r)-(b)a(z)
[regex "s/a../MM/ig" m.a] | [regex "s/a../MM/ig" m.a] | MM Def GHIMM
[loop [split "m/ +/" m.a] '([pass._])'] | [loop [split "m/ +/" m.a] '([pass._])'] | (ABc)(DeF)(GHIabC)
[loop [split "m/ +/" m.a 2] '([pass._])'] | [loop [split "m/ +/" m.a 2] '([pass._])'] | (ABc)(DeF GHIabC)
[if [regex "m/error/i" m.str] 1 0] | [if [regex "m/error/i" m.str] 1 0] | 1
[if ! [regex "m/error/i" m.str] 1 0] | [if ! [regex "m/error/i" m.str] 1 0] | 0
Note: "!" is only evaluated in the context of conditionals (ie. [! some.value] will not evaluate, but [if ! [some.value]] will.)

# Sprintf

[var p.a "1223.3434"] [var p.b "0.0054"] [var p.format "[p.s] Hi (%.3f)"] [var p.s "Hello"]

    [var p.a "1223.3434"]
    [var p.b "0.0054"]
    [var p.format "[p.s] Hi (%.3f)"]

Code | Produces | Should Look Like
--- | --- | ---
[sprintf "%02d %02d" p.a p.b] | [sprintf "%02d %02d" p.a p.b] | 1223 00
[sprintf "[p.s] %.2f %.2f" p.a p.b] | [sprintf "[p.s] %.2f %.2f" p.a p.b] | Hello 1223.34 0.01
[sprintf p.format p.a p.b] | [sprintf p.format p.a p.b] | Hello Hi (1223.343)

# NoWrap

Code | Produces | Should Look Like
--- | --- | ---
[nowrap Any amount [of matched [nested] braces] period ] | [nowrap Any amount [of matched [nested] braces] period ] | Any amount [of matched [nested] braces] period
[nowrap var regex = /[a-z]/; ] | [nowrap var regex = /[a-z]/; ] | var regex = /[a-z]/;

# ISML

Code | Produces | Should Look Like
--- | --- | ---
[isml.date;format='(%YDAY %YYYY %YY %Y) (%MONTH %MON %MM %M) (%DAY %DTH %DD %D) (%HH24 %HH12 %HH %H12) (%MI) (%SS) (%AM %PM) (%WEEKDAY %WDAY %WW %W)';timezone='US/Mountain'] | [isml.date;format='(%YDAY %YYYY %YY %Y) (%MONTH %MON %MM %M) (%DAY %DTH %DD %D) (%HH24 %HH12 %HH %H12) (%MI) (%SS) (%AM %PM) (%WEEKDAY %WDAY %WW %W)';timezone='US/Mountain'] | N/A
[isml.file;src="/ISML_include/isml_test.htm"] | [isml.file;src="/ISML_include/isml_test.htm"] | N/A
Note: All ISML types are available in wrap.

# Graph

Code | Produces | Should Look Like
--- | --- | ---
[push graph.data 34] [push graph.data 25] [push graph.data 90] [push graph.labels "Thirty-four"] [push graph.labels "Twenty-five"] [push graph.labels "Ninety"] [var graph.title "Hello"] [var graph.type "pie"] [graph.draw] | [push graph.data 34] [push graph.data 25] [push graph.data 90] [push graph.labels "Thirty-four"] [push graph.labels "Twenty-five"] [push graph.labels "Ninety"] [var graph.title "Hello"] [var graph.type "pie"] [graph.draw] | N/A
[var graph.labelRotate 45] [var graph.labelHeight 40] [var graph.type "bar"] [graph.draw] | [var graph.labelRotate 45] [var graph.labelHeight 40] [var graph.type "bar"] [graph.draw] | N/A
[delete graph] | [delete graph] |
[graph.text;text="How About That";bgcolor='blue';color='red';pt=20;trim_h=8] | [ graph.text;text="How About That";bgcolor='blue';color='red';pt=20;trim_h=8] |
[var a.t "Some Rotation"] | [ var a.t "Some Rotation"] |
[var graph.trim_h 5] | [ var graph.trim_h 5] |
[loop [.. -90 90 10] q{[graph.text;text=a.t;rotate=pass._]}] | [loop [.. -90 90 10] q{[graph.text;text=a.t;rotate=pass._]}] |
[var a.c "blue[alt]white"] | [ var a.c "blue[alt]white"] |
[var graph.rotate -80] | [ var graph.rotate -80] |
[var graph.width 40] | [ var graph.width 40] |
[var graph.height 145] | [ var graph.height 145] |
[loop 15 q{ [graph.text;text=anc.text;color=a.c;bgcolor=a.c] [if a.c] }] | [loop 15 q{[graph.text;text=anc.text;color=a.c;bgcolor=a.c][if a.c]}] |
[var a.words q{This is a really long section of text that I want to encode as images}] | [ var a.words q{This is a really long section of text that I want to encode as images}] |
[delete graph] | [ delete graph] |
[var graph.no_alt 1] | [ var graph.no_alt 1] |
[var graph.shift_y -4] | [ var graph.shift_y -4] |
[loop text [split "m/\b/" a.words] graph.text] | [ loop text [split "m/\b/" a.words] graph.text] |

[var graph.rotate -90] [var graph.trim_h 5] [var graph.bgcolor prefs.table_heading_bgcolor] [var graph.color 'midnightblue']

#

Code | Produces | Should Look Like
--- | --- | ---
[] | [] |
[] | [ ] |

This paragraph is simply a set of words containing [ symbol. This is a [test] to see if it will leave things like "!@!@$]#" alone.