Sign in Join
FPDoc Onlineexperiment

First steps with the IDE

Starting the IDE

The IDE is started by entering the command:

fp

at the command line. It can also be started from a graphical user interface such as Windows.

Remark:

  • Under Windows, it is possible to switch between windowed mode and full screen mode by pressing .

  • For a better user experience, it is recommended to customize the font, font size, colors, and other console/terminal settings to your preferences. Example configuration files for XTerm and Kitty terminals are listed in Appendix Terminal emulator configuration examples.

IDE command line options

When starting the IDE, command line options can be passed:

fp [-option] [-option] ... <file name> ...

Option is one of the following switches (the option letters are case insensitive):

-N

(DOSonly) Do not use long file names. Windows95 and later versions of Windowsprovide an interface to DOS applications to access long file names. The IDE uses this interface by default to access files. Under certain circumstances, this can lead to problems. This switch tells the IDE not to use the long filenames.

-Cfilename

Read IDE options from filename. There should be no whitespace between the file name and the -C. The extension of the filename is ignored, and files named filename.cfg, filename.dsk and filename.ini are used. More information on the configuration files can be found in section The IDE.

-R

Or -R+. After starting the IDE, change automatically to the directory which was active when the IDE exited the last time. -R- keeps the startup directory as the active directory. This overrides the configuration option Return to last directory (section The IDE).

-S

Disable the mouse. When this option is used, the use of a mouse is disabled, even if a mouse is present.

-Tttyname

(Linux/Unix only) Send program output to tty ttyname. This avoids having to continually switch between program output and the IDE.

The files given at the command line are loaded into edit windows automatically.

Remark: Under DOS/Win32, the first character of a command line option can be a / character instead of a - character. So /S is equivalent to -S.

IDE configuration files

Configuration files are essential for the IDE to function properly. If none are found, they will be created automatically. Therefore, the IDE expects to have write permission in the directory from which it is started.

The configuration consists of three files:

  • fp.cfg - Stores compiler related settings. This file is passed to the compiler as command line parameter: @fp.cfg.

  • fp.dsk - Stores data that should be preserved across IDE sessions. You can choose what to save in this desktop file via .

  • fp.ini - Contains the IDE’s own configuration settings.

When you start the IDE in a directory for the first time, there are four possible scenarios for the configuration files:

  1. Use default configuration files. The IDE creates a file named fp.dir. Desktop file: Config file directory is selected.

  2. Use default configuration files. The IDE creates the desktop file and file named fp.dir in the current directory. Desktop file: Current directory is selected.

  3. Copy default configuration files and save them in the current directory.

  4. Create new configuration files and save them in the current directory.

Possible locations for default configuration files:

  • Linux/Unix:

    1. ~/.fp

    2. Directory of the IDE executable.

    3. Current directory.

  • Windows:

    1. APPDATAfp3

    2. Directory of the IDE executable.

    3. Current directory.

  • Other platforms:

    1. Directory of the IDE executable.

On each sequential startup of the IDE in the same directory, ether fp.cfg, fp.dsk and fp.ini from the current directory will be used or default configuration files will be used if the fp.dir file exists.

The IDE screen

After start up, the screen of the IDE can look like figure [fig:idestart].

At the top of the screen the menu bar is visible, at the bottom the status bar. The empty space between them is called the desktop.

The status bar shows the keyboard shortcuts for frequently used commands, and allows quick access to these commands by clicking them with the mouse. At the right edge of the status bar, the current amount of unused memory is displayed. This is only an indication, since the IDE tries to allocate more memory from the operating system if it runs out of memory.

The menu provides access to all of the IDE’s functionality.

The IDE can be exited by selecting in the menu 4 or by pressing .

Remark: If a file fp.ans is found in the current directory, then it is loaded and used to paint the background. This file should contain ANSI drawing commands to draw on a screen.

Compiling your first program

To ensure that IDE is working and is setup properly, it is recommended that your first program is as simple as possible, but with useful feedback. A simple "Hello world!" program is a great choice. Open and enter the following program:

begin
  writeln('Hello world!');
end.

Save the program with . The program has to be saved before it can be compiled.

The next step is to test your program. Select the menu item or press (section The IDE). This command compiles your program if it was not already compiled or if it was modified since the last compile, and runs it. In case of success you will see a "Hello world!" message printed on the screen. Press to see the User screen when the program has returned to the IDE.

Compilation can fail. Failing is a normal part of development. In such a case, address the issue identified by the error message. Keep compiling until the program compiles successfully and the program can be run.

Here is how to resolve error: Fatal: Can’t find unit system used by Program.

Open and in tab Units enter valid path to location of system.ppu (section The IDE). If you have entered path, but error persists then open in tab Verbose check Used, tried info to get more information during compilation for further troubleshooting.

Remark: The IDE encorporates the compiler and it does not need to locate the command line compiler. The location of used units has to be supplied. The system unit is used implicitly by every program and unit. The IDE does make an educated guess and tries to preconfigure the location of units shipped with Free Pascal.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.