Mercurial > urweb
annotate tests/stringToTime.ur @ 2070:382911d72e63
Check realloc's return code to prevent segfault on out of memory condition (Part 3)
author | Sergey Mironov <grrwlf@gmail.com> |
---|---|
date | Tue, 02 Sep 2014 17:37:22 +0000 |
parents | 252e05bf199d |
children |
rev | line source |
---|---|
adam@1599 | 1 fun main () : transaction page = |
adam@1599 | 2 s <- source ""; |
adam@1599 | 3 return <xml><body> |
adam@1599 | 4 <ctextbox source={s}/> |
adam@1599 | 5 <button onclick={v <- get s; alert (show (readError v : time))}/> |
adam@1599 | 6 <button onclick={v <- get s; case read v : option time of |
adam@1599 | 7 None => alert "Invalid" |
adam@1599 | 8 | Some tm => alert (show tm)}/> |
adam@1599 | 9 </body></xml> |