Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failure when trying to compile pascal programs via Notepad++?

I’m trying to compile Pascal files with Notepad++ with the Free Pascal Compiler. I’ve been instructed to use the following script:

NPP_SAVE
cd $(CURRENT_DIRECTORY)
C:\FPC\2.6.4\bin\i386-win32\ppcrossx64.exe $(NAME_PART).pas

But when I try to run the program, the Notepad++ console gives me the following message:

  NPP_SAVE: C:\FPC\2.6.4\bin\i386-win32\new 1.pas
  CD: C:\FPC\2.6.4\bin\i386-win32
  Current directory: C:\FPC\2.6.4\bin\i386-win32
  C:\FPC\2.6.4\bin\i386-win32\ppcrossx64.exe new 1.pas
  Process started >>>
  Fatal: Can't open file "1.pas"
  Fatal: Compilation aborted
  <<< Process finished. (Exit code 1)
  ================ READY ================

I’ve tried to use also:

C:\FPC\2.6.4\bin\i386-win32\ppcrossx64.exe "$(FULL_CURRENT_PATH)"

But it gives me:

  C:\FPC\2.6.4\bin\i386-win32\ppcrossx64.exe "C:\FPC\2.6.4\bin\i386-win32\new 1.pas"
  Process started >>>
  <<< Process finished. (Exit code 0)
  ================ READY ================

Even if I have readln(); at the end of the program.

like image 312
Red Banana Avatar asked Aug 15 '26 15:08

Red Banana


1 Answers

Your second command (with the quotes) seems to compile successfully. It reports the exit code 0. You can try to deliberately include a syntax error and see if and how the compiler reports it.

I think what you are missing now is a way to run the program after the compile is successfull. You can create a second script with something like this:

cd "$(CURRENT_DIRECTORY)"
"$(NAME_PART).exe"

Bind the first compile script to a keyboard shortcut, bind the second run script to a different keyboard shortcut, only run when the compile is ok.

like image 83
Lars Fischer Avatar answered Aug 20 '26 10:08

Lars Fischer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!