IDE tricks

From Lazarus wiki
Jump to navigationJump to search

Create a new file with Open file

You can create a new file and save it, or you can create a new file with filename and filetype in one step: Just open file (Ctrl+o) and select an non existing file. For example: unit1.pas. The IDE will ask you if it should be created.

IDE macros

IDE Macros in paths and filenames

Getting the compiler command line parameters created by the IDE

You can copy the parameters from Project -> Compiler Options -> Show Options. Here the paths are relative to the project directory. So in most cases you can copy them without adjusting.

The parameters are also saved to the *.compiled file. For example if your project is called test1.lpi, then a test1.compiled is created. It is a simple text xml file, so you can just copy the options and adjust the paths to compile on another computer. The file is put into the same directory, where the executable is created.

For packages this works the same.

This way, you can compile your (hopefully working and bugfree) code, outside of the lazarus IDE.