Tutorial: Compile Pascal source code directly

Arion
2008-06-16
2012-11-13
  • Arion
    Arion
    2008-06-16

    I'm using Dev-Pascal to code in Pascal, but I'd rather use Notepad++ to do that.. After some research
    I finally discovered how to compile a Pascal source code directly from Notepad++.

    1 - Download Free Pascal Compiler from http://www.freepascal.org/ and install in any folder

    Obs: I'm using Windows Vista 32bits. Here's the direct link to any Window 32bits version: ftp://ftp.hu.freepascal.org/pub/fpc/dist/i386-win32-2.2.0/fpc-2.2.0.i386-win32.exe  (32 MB).

    2 - Open Notepad++ (I'm using v5.0 Beta) and go to menu Plugins >> NppExec >> Execute..   (or just press F6)

    Obs: NppExec is a plugin that came with Notepad++ v5.0 Beta, I don't know if previous versions also come with it.
    In that case, you just have to download the plugin from Notepad++ download page.

    3 - In the window that appear, write the following:

    <Free Pascal Compiler install folder>\bin\i386-win32\ppc386.exe "$(FULL_CURRENT_PATH)"

    This "ppc386.exe" is the compiler itself, and "$(FULL_CURRENT_PATH)" is the full path of the current file opened in Notepad++

    In my case it looked like this:
    C:\Program Files\FreePascalCompiler\bin\i386-win32\ppc386.exe "$(FULL_CURRENT_PATH)"

    4 - Click button "Save..." and save the command as "Compile Pascal Source File" or something like that, so you can quickly access the command at anytime.

    5 - Try an "Ok". Voilà!
    If the source code is correct, a window named "Console" will appear in the bottom of Notepad++ window with information about the compilation, and a executable file will appear in the source code folder.

    "Ctrl + F6" ReDo the last command. May be handy.

    Screenshots to illustrate the process:
    http://i41.photobucket.com/albums/e258/arionkrause/notepadpp_pascal_compiling.png

    Hope this tutorial may be helpful.
    I'm not a native english speaker, so be tolerant with any spelling errors that I may have commited