1

How to combine Free Pascal compiler and NP++ (or maybe other editor, Vim, Geany, ...)? i.e. I want something like IDE: compiling, running from NP++, list of errors\warnings. I tried http://sourceforge.net/projects/notepad-plus/forums/forum/331753/topic/2084061?message=5036415 but it doesn't work. Also tried some different code

cd $(CURRENT_DIRECTORY)
fpc $(NAME_PART).pas

but the same issue occurs

enter image description here

6
  • 1
    Why do you want use Notepad++ instead of Lazarus?
    – RRUZ
    Jan 22, 2012 at 17:27
  • It crashes sometimes (OS win7) and I need only console applications, not GUI designer, projects (I not sure because I uninstalled it few weeks ago, but as I can remember I can't just create\open .pas file, I need to create project etc.) and so on.
    – Alex P.
    Jan 22, 2012 at 18:34
  • 1
    FYI you cannot compile directly a .pas file without a project file (lpr).
    – RRUZ
    Jan 22, 2012 at 18:45
  • RRUZ: with FPC (and TP before it) you can. The FPC compiler itself is a .pp. Anyway, I would recommend lazarus too, trying to use general editors for such purposes only caused me pain in the past, and in the end they always want you to write a plugin Jan 23, 2012 at 9:56
  • Marco van de Voort: but maybe someone already wrote this plugin for any editor like NP++, Geany etc.?:)
    – Alex P.
    Jan 23, 2012 at 13:24

4 Answers 4

1

You should try ConText. I use it for Pascal programming. It isn't the most beautiful code editor, but I think that for Pascal it is the best. I use the "Turbo Pascal 7.0" highlighter from there. I have codes for commands like compile, run the .exe or open file in Free Pascal. If you'd like I can write them there.

1

I've used this script to compile and run the my pascal code:

cd $(CURRENT_DIRECTORY)
C:\FPC\2.6.0\bin\i386-Win32\fpc.exe $(NAME_PART).pas
$(NAME_PART).exe

Remember to change the fpc path if needed.

1

Hm, looks like np++ plugin mentioned in the question works, not sure what was the problem and why it did not create .exe when I first tried, but now everything works.

Also found SciTE editor, where it is possible to add something like

#using free pascal

# compile
command.compile.*.pas=fpc "$(FilePath)"

# normal execute
if PLAT_WIN
    command.go.*.pas="$(FileName).exe"
    command.go.subsystem.*.pas=2
if PLAT_GTK
    command.go.*.pas="kvt -e $(FileName)"

# build
command.build.*.pas=fpc -B "$(FilePath)"
command.build.subsystem.*.pas=1

command.name.0.*.pas=Debug Compile
command.0.*.pas=fpc -g "$(FilePath)"
command.name.1.*.pas=Debug Build
command.1.*.pas=fpc -g -B "$(FilePath)"
command.name.2.*.pas=GDB
if PLAT_WIN
    command.2.*.pas=gdbpasw "$(FileName)"
if PLAT_GTK
    command.2.*.pas=gdb "$(FileName)"
    command.name.3.*.pas=DDD
    command.3.*.pas=ddd "$(FileName)"

to pascal.properties. Or here it is already included: http://code.google.com/p/scite-ru/downloads/list

0

Maybe try this code:

NPP_SAVE
cd $(CURRENT_DIRECTORY)
CMD.EXE /C if exist $(Name_PART).exe DEL $(Name_PART).exe
fpc.exe "$(FULL_CURRENT_PATH)"

It is for compiling

1
  • It's an old question, and he said later in an answer that it got solved on it's own
    – Omri Luzon
    May 27, 2017 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.