# !bell(4)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

!bell - Sound audio alarm

## SYNOPSIS

!bell [n]

## DESCRIPTION

!bell provides a warning (audible or visual) to alert the user of a problem. !bell honors the quiet(5) setting, as such if quiet mode is disabled an audible warning is given, otherwise a visual warning is given to the user (usually the message "[BELL]" in the bottom left hand corner of the message line).

The optional numerical argument n over-rides the current setting of quite, a value of `0` specifies a quite bell, `2` an audible one, when omitted the default is `1` honoring the setting of quite mode.

!bell is generally used in conjunction with !abort, the !bell function warning the user and the !abort function to quit the macro.

## EXAMPLE

The following macro example checks for incoming mail and is taken from `mail.emf`. If any mail has arrived an audible warning is assured by toggling the quiet mode.

    ;
    ; Mail checker
    define-macro mail-check
        !if &seq &set %vm-mail-src &reg &spr "/history/%s/mail-src"  $platform ""
            ml-write "[Incoming mail file not setup! Execute mail-setup to configure]"
            !abort
        !endif
        600000 create-callback mail-check
        ml-write &spr "Checking for mail in %s..." %vm-mail-src
        set-variable #l0 &cond &gre &stat "s" %vm-mail-src 0 "M" "-"
        !if &not &seq &mid $mode-line 2 1 #l0
            set-variable #l1 &rig $mode-line &cond &seq &mid $mode-line 2 1 "%" 4 3
            set-variable $mode-line &cat &cat &lef $mode-line 2 #l0 #l1
            screen-update
            !if &seq #l0 "M"
                ; use an argument to !bell so it toggles it back to its original state
                !bell 0
                !bell 2
            !endif
        !endif
        0 ml-write
    !emacro

## SEE ALSO

!abort(4), abort-command(2), !bell(4).

(c) Copyright JASSPA 2009
Last Modified: 2009/10/03
Generated On: 2009/10/12

</HMTL>