PL/I Counter and Theme Toggle - Pli Typing CST Test
Loading…
PL/I Counter and Theme Toggle — Pli Code
Demonstrates a simple counter with theme toggling using PL/I variables and procedures.
DECLARE count FIXED BINARY(31) INITIAL(0);
DECLARE isDark BIT(1) INITIAL('0'B);
UPDATEUI: PROCEDURE OPTIONS(MAIN);
PUT SKIP LIST('Counter: ', count);
IF isDark = '1'B THEN
PUT SKIP LIST('Theme: Dark');
ELSE
PUT SKIP LIST('Theme: Light');
END;
END UPDATEUI;
INCREMENT: PROCEDURE;
count = count + 1;
CALL UPDATEUI();
END INCREMENT;
DECREMENT: PROCEDURE;
count = count - 1;
CALL UPDATEUI();
END DECREMENT;
RESET: PROCEDURE;
count = 0;
CALL UPDATEUI();
END RESET;
TOGGLETHEME: PROCEDURE;
IF isDark = '0'B THEN
isDark = '1'B;
ELSE
isDark = '0'B;
END;
CALL UPDATEUI();
END TOGGLETHEME;
/* Simulate actions */
CALL UPDATEUI();
CALL INCREMENT();
CALL INCREMENT();
CALL TOGGLETHEME();
CALL DECREMENT();
CALL RESET();Pli Language Guide
PLI (Programming Language One) is a procedural, compiled language designed for business and systems programming, particularly for large-scale data processing and legacy IBM mainframe environments.
Primary Use Cases
- ▸Large-scale batch processing
- ▸Business and financial systems
- ▸Mainframe application maintenance
- ▸Data processing for enterprises
- ▸Legacy system integration and updates
Notable Features
- ▸Structured programming constructs
- ▸Strong support for record and array data types
- ▸Compiled for IBM mainframes
- ▸Integrated input/output for batch processing
- ▸Efficient memory and file handling
Origin & Creator
Developed by IBM in the 1960s, primarily as a high-level language for business and systems applications on mainframe computers.
Industrial Note
PLI remains in use in legacy IBM mainframe environments for maintaining mission-critical financial and administrative systems.