# Data Types
DWScript is a strongly-typed language, meaning every variable and expression has a specific type known at compile time. This ensures better performance, safety, and tooling support.
## Core Primitives
These are the fundamental building blocks of most scripts.
* **[Integers](/lang/basics/ints)**: 64-bit signed whole numbers.
* **[Floats](/lang/basics/floats)**: 64-bit double-precision floating-point numbers.
* **[Booleans](/lang/basics/bools)**: Logical `True` or `False` values.
* **[Strings](/lang/basics/strings)**: Unicode (UTF-16) sequences of characters.
## Structural Types
Types used to organize and group data.
* **[Arrays](/lang/basics/arrays)**: Ordered collections of a single type (Static or Dynamic).
* **[Associative Arrays](/lang/basics/associative_arrays)**: Key-value maps (dictionaries).
* **[Records](/lang/basics/records)**: Lightweight value-type structures.
* **[Classes](/lang/oop/oop)**: Full-featured object-oriented reference types.
* **[Enums & Sets](/lang/basics/enums_sets)**: Named constants and bitfield collections.
## Specialized Types
DWScript includes specialized types for specific domains or dynamic behavior.
* **[Variants](/lang/basics/variants)**: Highly dynamic types that can hold any value.
* **[Big Integers](/lang/basics/bigints)**: Arbitrary-precision whole numbers.
* **[Binary Data](/lang/basics/binary)**: Raw byte buffers for I/O and crypto.
* **[File Handles](/lang/basics/files)**: Handles for low-level file system operations.
## Type Casting & Conversion
DWScript provides several ways to move data between types:
1. **Implicit Conversion**: For safe operations, like assigning an `Integer` to a `Float`.
2. **Explicit Casting**: Using the `Type(Value)` syntax for potentially unsafe conversions.
3. **Method Helpers**: Using `.ToString`, `.ToInt`, etc., for semantic conversions.
```pascal
var i: Integer := 10;
var f: Float := i; // Implicit
var s: String := i.ToString; // Helper method
// OUTPUT NONE
```
## Identifiers
DWScript is fully Unicode-aware. You can use Unicode characters in variable names, function names, and other identifiers.
```pascal
var 測試 := 'Unicode variable';
PrintLn(測試);
// OUTPUT
// Unicode variable
```
## Indexing Strategy
DWScript follows a hybrid indexing strategy to balance modern conventions with Pascal compatibility.
:::warning
**Indexing Gotcha**
* **Arrays** are **0-indexed** (start at 0), matching C/C++/C#/Java/JavaScript.
* **Strings** are **1-based** (start at 1), matching standard Pascal/Delphi.
Always be mindful of this distinction when switching between string manipulation and array processing.
:::
Data Types
DWScript is a strongly-typed language, meaning every variable and expression has a specific type known at compile time. This ensures better performance, safety, and tooling support.
Core Primitives
These are the fundamental building blocks of most scripts.