Skip to content
Podorov Alexey edited this page Nov 1, 2021 · 27 revisions

PL/2 Tutorial

PL/2 is a programming tutorial language with native language preprocessing support. See international project for more.

File structure

File is a simple text file (with .pl2 extension)

The program section begins from the source tag at first position of line, and ends with /source tag at first position of line.

source keyword have a attribute:
mode: mode="<type>"
where type are

  • pl2 - PL/2 source code
  • text - text as a strings with system line breaks
  • form - forms definition
  • menu - menu description
  • table - table like data
  • tree - data with hierarhy
  • html - HTML source
  • sql - SQL source instructions
  • game - PL/2 script

name: name="<section_name>"
where section_name - indentifier for access to section text from source code

PL/2 source format

Every structure indent have 4 space
Continue operator to next line - 3 or more space from block start position

Hallo world

/%...%/ - identifier comment start and end simbol
// - to end of line comment
/* ... */ - block comment
if keyword program used, code plase in default.Default.Main() static method

source mode="pl2" name="example2"
    using user.OS.IO; // using OS Console interface

    program /* static Main() method in Default class from default namespace */
       (String arguments[] /%execution time command line parameters%/ )
    {&
        Console.write_line("Hallo, world!");
    &}
/source
Clone this wiki locally