Debian Codegraph @

examples/windows/errordialog.scm

raw
1 ;; examples/windows/errordialog.scm
2 ;; Public domain
3
4 (use os.windows)
5
6 ;; It is a good idea for Windows scripts to catch an error at the outermost
7 ;; level, since the error console will be immediately gone after program
8 ;; exits in non-console mode.
9 (define (main args)
10 (guard (e [else (sys-message-box #f (format "ERROR: ~a" (condition-message e))
11 (sys-basename *program-name*)
12 (logior MB_OK MB_ICONERROR))])
13 (sys-sleep 1)
14 (error "We got an error!"))
15 0)