Mercurial > urweb
comparison tests/env.ur @ 1799:3d922a28370b
Basis.getenv
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Thu, 02 Aug 2012 16:33:25 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1798:10a2cb93d175 | 1799:3d922a28370b |
---|---|
1 fun handler r = | |
2 vo <- getenv (blessEnvVar r.Nam); | |
3 return <xml><body> | |
4 {case vo of | |
5 None => <xml>Not set</xml> | |
6 | Some v => <xml>Set to: {[v]}</xml>} | |
7 </body></xml> | |
8 | |
9 fun main () : transaction page = | |
10 term <- getenv (blessEnvVar "TERM"); | |
11 return <xml><body> | |
12 TERM = {case term of | |
13 None => <xml>Nada</xml> | |
14 | Some v => txt v} | |
15 | |
16 <form> | |
17 What would you like to know? | |
18 <textbox{#Nam}/> | |
19 <submit action={handler}/> | |
20 </form> | |
21 </body></xml> |