diff options
author | 2012-08-02 16:33:25 -0400 | |
---|---|---|
committer | 2012-08-02 16:33:25 -0400 | |
commit | fdc6c1310be60fbeb597400618473861f78676de (patch) | |
tree | 201d14d77f7f944545809bff02ae45fc826bb7e7 /tests/env.ur | |
parent | 722b0c632007ac6ea178b05695974e447b4288a3 (diff) |
Basis.getenv
Diffstat (limited to 'tests/env.ur')
-rw-r--r-- | tests/env.ur | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/env.ur b/tests/env.ur new file mode 100644 index 00000000..637ea6b8 --- /dev/null +++ b/tests/env.ur @@ -0,0 +1,21 @@ +fun handler r = + vo <- getenv (blessEnvVar r.Nam); + return <xml><body> + {case vo of + None => <xml>Not set</xml> + | Some v => <xml>Set to: {[v]}</xml>} +</body></xml> + +fun main () : transaction page = + term <- getenv (blessEnvVar "TERM"); + return <xml><body> + TERM = {case term of + None => <xml>Nada</xml> + | Some v => txt v} + + <form> + What would you like to know? + <textbox{#Nam}/> + <submit action={handler}/> + </form> + </body></xml> |