# Run-Time Type Information
RTTI (Run-Time Type Information) allows your code to inspect types, objects, and metadata while the program is running.
## Inspecting Types
You can get type information using `TypeOf` (for class symbols).
```pascal
type
TUser = class
Name : String;
end;
var info := TypeOf(TUser);
PrintLn('Class Name: ' + info.Name);
// OUTPUT
// Class Name: TUser
```
## Attributes
Attributes attach metadata to symbols.
```pascal
type
ColumnAttribute = class(TCustomAttribute)
FName : String;
constructor Create(const name : String); begin FName := name; end;
end;
type
[ColumnAttribute('USERS')]
TUserWithAttr = class
Name : String;
end;
// Iterate through attributes
var attrs := RTTIRawAttributes;
for var i := 0 to attrs.Length - 1 do begin
if attrs[i].T = TypeOf(TUserWithAttr) then begin
if attrs[i].A is ColumnAttribute then
PrintLn('Found column mapping: ' + ColumnAttribute(attrs[i].A).FName);
end;
end;
// OUTPUT
// Found column mapping: USERS
```
:::info
### Related Reference
For detailed information on `TTypeInfo` members and the `RTTIRawAttributes` structure, see the reference documentation:
* **[RTTI API Reference](/ref/rtti)**
:::
Run-Time Type Information
RTTI (Run-Time Type Information) allows your code to inspect types, objects, and metadata while the program is running.
Inspecting Types
You can get type information using TypeOf (for class symbols).
type
TUser =class
Name :String;end;var info := TypeOf(TUser);
PrintLn('Class Name: '+ info.Name);
Result
Class Name: TUser
Attributes
Attributes attach metadata to symbols.
type
ColumnAttribute =class(TCustomAttribute)
FName :String;constructor Create(const name :String);begin FName := name;end;end;type[ColumnAttribute('USERS')]
TUserWithAttr =class
Name :String;end;// Iterate through attributesvar attrs := RTTIRawAttributes;forvar i :=0to attrs.Length -1dobeginif attrs[i].T = TypeOf(TUserWithAttr)thenbeginif attrs[i].A is ColumnAttribute then
PrintLn('Found column mapping: '+ ColumnAttribute(attrs[i].A).FName);end;end;
Result
Found column mapping: USERS
Related Reference
For detailed information on TTypeInfo members and the RTTIRawAttributes structure, see the reference documentation: