Terminal control/Ringing the terminal bell: Difference between revisions

Content added Content deleted
imported>Acediast
(→‎{{header|COBOL}}: completed standard-compliant program)
imported>Acediast
(→‎{{header|COBOL}}: added another implementation)
Line 292: Line 292:


=={{header|COBOL}}==
=={{header|COBOL}}==
Using the standard screen section:
Standard compliant:
{{works with|GnuCOBOL}}
{{works with|GnuCOBOL}}
<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
Line 306: Line 306:


END PROGRAM ring-terminal-bell.</syntaxhighlight>
END PROGRAM ring-terminal-bell.</syntaxhighlight>

Using the ASCII code directly:
{{works with|GnuCOBOL}}
<syntaxhighlight lang="cobol"> *> Tectonics: cobc -xj ring-terminal-bell.cob -fnot-reserved=ASCII
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
GOBACK.

END PROGRAM ring-ascii-bell.</syntaxhighlight>


{{works with|Visual COBOL}}
{{works with|Visual COBOL}}