Skip to main content

Pascal Script: Types

TODOTODO: Review

This page lists and explains all supported types in Pascal Script used within ReNamer.

Integer types

TypeSizeMinimum ValueMaximum Value
Byte1 byte0255
ShortInt1 byte-128127
Word2 bytes065,535
SmallInt2 bytes-32,76832,767
Cardinal4 bytes04,294,967,295
Integer4 bytes-2,147,483,6482,147,483,647
Int648 bytes-9,223,372,036,854,775,8089,223,372,036,854,775,807

Floating point types

TypeSizeSmallest NumberLargest Number
Single4 bytes1.5 x 10-453.4 x 1038
Double8 bytes5.0 x 10-3241.7 x 10308
Extended10 bytes3.6 x 10-49511.1 x 104932

String types

TypeDescription
CharStores a single 8-bit character.
StringHolds a sequence of 8-bit characters. Commonly used for ANSI or UTF-8 encoded text.
AnsiCharAlias for Char type.
AnsiStringAlias for String type.
WideCharStores a single 16-bit character.
WideStringHolds a sequence of 16-bit characters. Commonly used for UCS-2 or UTF-16 encoded text.
UnicodeCharAlias for WideChar type.
UnicodeStringAlias for WideString type.

The default encoding for String/AnsiString type and the conversion process to/from UnicodeString/WideString type differ between versions of ReNamer.

ReNamer versionDefault encoding for AnsiString typeConversion between WideString and AnsiString types
7.0 and laterUTF8Automatic, on assignment
Prior to 7.0Active system code pageManual, using conversion functions

The Unicode article highlights the differences between various encodings.

Mixed types

TypeDescription
BooleanLogical value which can be either True and False..
ArraySingle and multi dimensional indexable sequence of data.
RecordA structure that holds a set of different data types.
VariantFlexible type which can hold any data.
PCharPointer to a Char value, and can also be used to point to characters within a string.

Extra types

Several extra types have been defined to simplify the use of some functions.

TypeDeclared asDescription
TDateTimeDoubleRepresents a date and time.
TStringsArrayArray of WideStringIndexed list of WideString values.

Deprecated in v5.74.4 Beta. Please use TWideStringArray instead.
TWideStringArrayArray of WideStringIndexed list of WideString values.

Added in v5.74.4 Beta. Replaces ambiguous TStringsArray type.
TAnsiStringArrayArray of AnsiStringIndexed list of AnsiString values.

Added in v5.74.4 Beta.
TIntegerArrayArray of IntegerIndexed list of Integer values.

Added in v7.3.0.4 Beta.

Enumerations and Sets

An enumeration is simply a fixed range of named values.

For example, the fundamental Boolean data type can be considered as an enumeration consisting of two values: True and False.

A variable of an enumeration type can be assigned a single value from the enumeration.

type
  TDay = (Mon, Tue, Wed, Thu, Fri, Sat, Sun);
var
  Day: TDay;
begin
  Day := Mon;
  if Day <> Tue then
    Day := Wed;
end.

Sets allow you to defined variables which can hold multiple values out of the enumeration.

type
  TDay = (Mon, Tue, Wed, Thu, Fri, Sat, Sun);
  TDays = set of TDay;
var
  Days: TDays;
begin
  Days := [Mon, Tue, Wed];
  if Sun in Days then
    Days := Days - [Sun];
end.