The Delphi project file (.dpr) contains the initialization logic for the program. It is partially generated by the IDE, is generally abstracted over by the .dproj file, and is underemphasized in editor tooling.
Use of the project file for complex logic bloats the application entry point, makes the project more difficult to navigate, and reduces visibility.
Move any complex logic into a routine in a separate unit, which you can then reference from the initialization section of the project file:
// MyProject.dpr // ... var MyVar: string; begin MyVar := Readln; Writeln(MyVar); end.
// MyProject.dpr // ... uses MyUnit; begin Foo; end. // MyUnit.pas interface procedure Foo; implementation procedure Foo; var MyVar: string; begin MyVar := Readln; Writeln(MyVar); end;