PL/1中的冒泡排序(How to write Bubble Sort with PL/1)

十二月 4, 2008 by Raymond · Leave a Comment
Filed under: PL/1 

SHELL:   PROCEDURE OPTIONS (MAIN);
         DECLARE
           ARRAY(50) FIXED BIN(15),
           (K,N) FIXED BIN(15);

         GET LIST(N);
         GET EDIT((ARRAY(K) DO K = 1 TO N));
         PUT EDIT((ARRAY(K) DO K = 1 TO N));
         CALL BUBBLE(ARRAY,N);
END BUBBLE;

BUBBLE:   PROCEDURE(ARRAY,N); /* BUBBLE SORT*/
          DECLARE (I,J) FIXED BIN(15);
          DECLARE S BIT(1);        /* SWITCH */
          DECLARE Y FIXED BIN(15); /* TEMPO */
          DO I = N-1 BY -1 TO 1;
            S = ’1′B;
            DO J = 1 TO I;
              IF X(J)>X(J+1) THEN DO;
                S = ’0′B;
                Y = X(J);
                X(J) = X(J+1);
                X(J+1) = Y;
                END;
              END;
            IF S THEN RETURN;
            END;
          RETURN;
          END SRT;

VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

PL/1中的Hello World(How to write Hello World with PL/1)

十二月 4, 2008 by Raymond · Leave a Comment
Filed under: PL/1 
HELLO:   PROCEDURE OPTIONS (MAIN);
             /* A PROGRAM TO OUTPUT HELLO WORLD */
             FLAG = 0;
LOOP:     DO WHILE (FLAG = 0);
             PUT SKIP DATA('HELLO WORLD!');
          END LOOP;
END HELLO;
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Notes in my PLI studying (ENDFILE)

二月 19, 2008 by pierre · 1 Comment
Filed under: 开发指南||Programming Guide 

This is some notes about a condition parameter ENDFILE.

As we know , ENDFILE is used for checking whether the read operation is reach the end of the input file, 

for examp: Read more

VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

PLI Overview

一月 20, 2007 by billrain · Leave a Comment
Filed under: 开发指南||Programming Guide 

PL/I is a general-purpose programming language, which is used for solving problems in a variety of fields such as commerce, science (including mathematics, physics, chemistry), engineering (including civil, electrical, aeronautics), medicine and so on. It can be used for system programming, and the facilitites are such that it is rarely if ever necessary to resort to machine-language or assembly-language programming to solve problems.

PL/I has outstanding facilities for commercial and business use. It has more power than Pascal, Fortran 95, BASIC, C, and COBOL, and has comparable facilities to Ada. The main areas where PL/I is superior include interrupt handling, the built-in debugging aids, the macro processor facilities, string-handling, and input-output (see below).

The language has good documenting and self-documenting facilities; programs are easy to read and to understand. It bears some resemblance to Fortran and BASIC.

The language is suitable for beginners, as well as for anyone wanting to become a professional.

VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

  • 分类目录

  • 功能

  • 联络订阅

    google reader
    订阅到抓虾
    订阅到鲜果
    订阅到飞鸽
    bloglines
    my yahoo
    netvibes