Terminal control/Ringing the terminal bell: Difference between revisions

alarm in BLC
(Add lang example)
(alarm in BLC)
(9 intermediate revisions by 3 users not shown)
Line 38:
swi ;Return to the monitor
.en</syntaxhighlight>
=={{header|8086 Assembly}}==
 
=={{header|8086 Assembly}}==
===Using stdout===
{{trans|X86 Assembly}}
Line 163:
 
=={{header|Ada}}==
 
<syntaxhighlight lang="ada">with Ada.Text_IO; use Ada.Text_IO;
with Ada.Characters.Latin_1;
Line 191 ⟶ 190:
 
=={{header|AWK}}==
 
<syntaxhighlight lang="awk">BEGIN {
print "\a" # Ring the bell
Line 232 ⟶ 230:
<syntaxhighlight lang="bbcbasic">VDU 7</syntaxhighlight>
 
=={{header|Bcbc}}==
<syntaxhighlight lang="bc">print "\a"</syntaxhighlight>
 
=={{header|beeswax}}==
 
<syntaxhighlight lang="beeswax">_7}</syntaxhighlight>
 
=={{header|Befunge}}==
<syntaxhighlight lang="befunge">7,@</syntaxhighlight>
 
=={{header|Binary Lambda Calculus}}==
 
The 2-byte BLC program <code>20 07</code> in hex outputs ASCII code 7.
 
=={{header|Bracmat}}==
Line 261 ⟶ 262:
 
=={{header|C}}==
 
<syntaxhighlight lang="c">#include <stdio.h>
int main() {
Line 292:
 
=={{header|COBOL}}==
Using the standard screen section:
Standard compliant:
{{works with|X/Open COBOL}}
<syntaxhighlight lang="cobol">DISPLAY SPACE WITH BELL</syntaxhighlight>
{{works with|COBOL 2002}}
<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
PROGRAM-ID. ring-terminal-bell.
 
DATA DIVISION.
SCREEN SECTION.
01 ringer BELL.
 
PROCEDURE DIVISION.
GOBACKDISPLAY ringer.
STOP RUN.
 
END PROGRAM ring-terminal-bell.</syntaxhighlight>
 
Using the ASCII code directly:
{{works with|COBOL-85}}
<syntaxhighlight lang="cobol"> *> Tectonics: cobc -xj ring-terminal-bell.cob --std=cobol85
IDENTIFICATION DIVISION.
PROGRAM-ID. ring-ascii-bell.
 
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
OBJECT-COMPUTER.
PROGRAM COLLATING SEQUENCE IS ASCII.
SPECIAL-NAMES.
ALPHABET ASCII IS STANDARD-1.
 
PROCEDURE DIVISION.
DISPLAY FUNCTION CHAR(8) WITH NO ADVANCING.
*> COBOL indexes starting from 1.
STOP RUN.
 
END PROGRAM ring-ascii-bell.</syntaxhighlight>
 
{{works with|Visual COBOL}}
<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
PROGRAM-ID. mf-bell.
 
DATA DIVISION.
WORKING-STORAGE SECTION.
01 bell-code PIC X USAGE COMP-X VALUE 22.
01 dummy-param PIC X.
 
PROCEDURE DIVISION.
CALL X"AF" USING bell-code, dummy-param
GOBACK.
 
GOBACK
END PROGRAM mf-bell.</syntaxhighlight>
 
=={{header|Common Lisp}}==
Line 320 ⟶ 353:
writeln('\a');
}</syntaxhighlight>
 
=={{header|dc}}==
<syntaxhighlight lang="dc">7P</syntaxhighlight>
 
=={{header|Delphi}}==
Line 363 ⟶ 399:
 
{{works with|GNU Forth}}
 
<syntaxhighlight lang="forth">#bell emit</syntaxhighlight>
 
{{works with|iForth}}
 
<syntaxhighlight lang="forth">^G emit</syntaxhighlight>
 
Line 395 ⟶ 429:
 
=={{header|Icon}} and {{header|Unicon}}==
 
Works on both Icon and Unicon.
 
Line 418 ⟶ 451:
}
}</syntaxhighlight>
 
=={{header|Joy}}==
<syntaxhighlight lang="coboljoy">DISPLAY7 SPACE WITH BELLputch.</syntaxhighlight>
 
=={{header|Julia}}==
Line 591 ⟶ 627:
=={{header|Objeck}}==
<syntaxhighlight lang="objeck">7->As(Char)->PrintLine();</syntaxhighlight>
 
=={{header|OCaml}}==
<syntaxhighlight lang="ocaml">let () = print_string "\x07"</syntaxhighlight>
 
=={{header|PARI/GP}}==
Line 654 ⟶ 693:
 
=={{header|Quackery}}==
 
On some platforms the bell will not ring until the output buffer is flushed e.g. by a cr/lf.
 
Line 766 ⟶ 804:
 
=={{header|Wren}}==
<syntaxhighlight lang="ecmascriptwren">System.print("\a")</syntaxhighlight>
 
=={{header|X86 Assembly}}==
56

edits