products/sources/formale Sprachen/Cobol/verschiedene-Autoren/Randy Lejeune image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei: test.cob   Sprache: Cobol

Original von: verschiedene©

       IDENTIFICATION DIVISION.
       PROGRAM-ID. GEEKCODE.
      ******************************************************************
      *                                                                *
      *AUTHOR. RANDY LEJEUNE.                                          *
      *DATE-WRITTEN.  29  SEP 2010.                                    *
      *                                                                *
      ******************************************************************
       ENVIRONMENT DIVISION.

       CONFIGURATION SECTION.

           SOURCE-COMPUTER. IBM-386.
           OBJECT-COMPUTER. IBM-386.

       INPUT-OUTPUT SECTION.

       FILE-CONTROL.
           SELECT GEEK-SIG             ASSIGN TO "geekcode.sig"
                                       ORGANIZATION IS LINE SEQUENTIAL.
       DATA DIVISION.

       FILE SECTION.

       FD  GEEK-SIG. 
       01  GEEK-OUTPUT-REC             PIC X(80).

       WORKING-STORAGE SECTION.

       COPY "geekcode.cpy".

       77  WS-PRINT-LINE1              PIC X(80)     VALUE SPACES.
       77  WS-PRINT-LINE2              PIC X(80)     VALUE SPACES.
       77  WS-PRINT-LINE3              PIC X(80)     VALUE SPACES.
       77  WS-PRINT-LINE4              PIC X(80)     VALUE SPACES.

       PROCEDURE DIVISION.

       00000-CONTROL.
           PERFORM 10000-SETUP
           PERFORM 20000-PROCESS
           PERFORM 30000-CLEANUP.

       10000-SETUP.
           ACCEPT WS-CL-ARGS FROM COMMAND-LINE END-ACCEPT
           PERFORM 93000-PARSE-CMDLN
           OPEN OUTPUT GEEK-SIG
           INITIALIZE  GEEK-OUTPUT-REC.

           END-DISPLAY
           DISPLAY " and can use a word processor without resor
      -        "ting to the manual too. "
           END-DISPLAY
           DISPLAY " often. I know that a 3.5 inch disk is not
      -        " a hard disk. I also "
           END-DISPLAY
           DISPLAY " know that when it says 'press any key' to
      -        "continue, I don't have to "
           END-DISPLAY
           DISPLAY " look for a key labeled 'ANY'. "
           END-DISPLAY
           DISPLAY " 5 C Computers are a tool, nothing more. I use
      -        "it when it serves my "
           END-DISPLAY
           DISPLAY " purpose." END-DISPLAY
           DISPLAY " 6 C- Anything more complicated than my calculat
      -        "or and I'm screwed. "
           END-DISPLAY
           DISPLAY " 7 C-- Where's the on switch? " END-DISPLAY
           DISPLAY " 8 C--- If you even mention computers, I will rip
      -         "your head off! "
           END-DISPLAY
           DISPLAY " " END-DISPLAY
           DISPLAY " " END-DISPLAY
           DISPLAY " " END-DISPLAY
           DISPLAY "Enter your Computer code "
               "number here [0 to quit]: " WITH NO ADVANCING
           END-DISPLAY

           ACCEPT WS-ENTRY END-ACCEPT

           IF WS-ENTRY (2:1) = SPACE
               MOVE WS-ENTRY (1:1) TO WS-ENTRY (2:1)
               MOVE 0              TO WS-ENTRY (1:1)   
           END-IF

           IF WS-ENTRY NOT NUMERIC
               CONTINUE 
           ELSE
               IF WS-ENTRY <= 08
                   SET WS-VALID-FLAG TO "Y"
                   IF WS-ENTRY = 00 THEN
                       PERFORM 92000-ABEND
                   ELSE IF WS-ENTRY = 01 THEN
                       MOVE "C++++" TO WS-COMP
                   ELSE IF WS-ENTRY = 02 THEN
                       MOVE "C+++" TO WS-COMP
                   ELSE IF WS-ENTRY = 03 THEN
                       MOVE "C++" TO WS-COMP
                   ELSE IF WS-ENTRY = 04 THEN
                       MOVE "C+" TO WS-COMP
                   ELSE IF WS-ENTRY = 05 THEN
                       MOVE "C" TO WS-COMP
                   ELSE IF WS-ENTRY = 06 THEN
                       MOVE "C-" TO WS-COMP
                   ELSE IF WS-ENTRY = 07 THEN
                       MOVE "C--" TO WS-COMP
                   ELSE IF WS-ENTRY = 08 THEN
                       MOVE "C---" TO WS-COMP
                   END-IF
               END-IF
           END-IF.

           PERFORM 90000-CLEAR-SCREEN.

       94000-TERMINATE.
           GOBACK.

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤





Download des
Quellennavigators
Download des
sprechenden Kalenders

in der Quellcodebibliothek suchen




Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.


Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.


Bot Zugriff