Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 010670e365eac4bfdf0087ea1c497c2e > files > 97

gauche-0.9.3.2-1.fc15.i686.rpm

;; examples/windows/errordialog.scm
;; Public domain

(use os.windows)

;; It is a good idea for Windows scripts to catch an error at the outermost
;; level, since the error console will be immediately gone after program
;; exits in non-console mode.
(define (main args)
  (guard (e [else (sys-message-box #f (format "ERROR: ~a" (~ e'message))
                                   (sys-basename *program-name*)
                                   (logior MB_OK MB_ICONERROR))])
    (sys-sleep 1)
    (error "We got an error!"))
  0)