Notepad++ + fpc compiler
-
20-04-2021 - |
Pregunta
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
Solución 3
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
Otros consejos
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.
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.
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