Language Overview

DWScript is an object-oriented scripting language based on Delphi (Object Pascal). It features a strong type system, high performance, and a rich standard library. This guide is organized into the following sections:

1. Getting Started

2. Types & Variables

3. Operators

4. Control Flow

  • Loops
    for, while, and repeat loops.
  • Conditionals
    if statements and case blocks.
  • Iteration
    Iterating over collections and ranges.
  • Exceptions
    Error handling with try...except and try...finally.

5. Data Structures

6. Functions

  • Subroutines
    Procedures and functions.
  • Parameters
    Passing values, constants, and references.
  • Contracts
    Design-by-contract features (requires/ensures).
  • Lambdas
    Anonymous functions and closures.

7. Object Oriented Programming

8. Files & System

9. Web & Database

10. Advanced Topics

Gotcha: Be aware of the difference between Array (0-indexed) and String (1-based) indexing. See Indexing Strategy for details.

On this page