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

RRUZ
  • 134,889
  • 20
  • 356
  • 483
Alex P.
  • 3,697
  • 9
  • 45
  • 110
  • 1
    Why do you want use Notepad++ instead of [Lazarus](http://www.lazarus.freepascal.org/)? – RRUZ Jan 22 '12 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 '12 at 18:34
  • 1
    FYI you cannot compile directly a .pas file without a project file (lpr). – RRUZ Jan 22 '12 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 – Marco van de Voort Jan 23 '12 at 09:56
  • Marco van de Voort: but maybe someone already wrote this plugin for any editor like NP++, Geany etc.?:) – Alex P. Jan 23 '12 at 13:24
  • Not that I know. Nearly everybody uses Lazarus. A few (like me) use the textmode IDE that comes with FPC (fp.exe). There used to be a VI syntax highlighter file, and also some XCode stuff, but those are all very simplistic and crude if you are used to a real IDE. Anyway, +1 for the trouble so you get something out of this :_) – Marco van de Voort Jan 23 '12 at 20:22

4 Answers4

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.

Mahoor13
  • 5,297
  • 5
  • 23
  • 24
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.

Tom
  • 21
  • 1
  • 1
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

Alex P.
  • 3,697
  • 9
  • 45
  • 110
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