# command to compile and execute code in COBOL

• I have a cobalt code and I would like to compile it

• @Davila-w.w

I would use npp_exec plugin in order to achieve this but you can use the standard Run menu as well, depends how flexible you want to be.

Cheers
Claudia

• … For example, here’s an NppExec script that I use to save, compile, and run a standalone C++ program:

npp_save
cd "$(CURRENT_DIRECTORY)" g++ "$(FILE_NAME)" -o "$(NAME_PART)" npp_run cmd.exe /k "$(NAME_PART)"


For compiling cobol, you would use your cobol compiler rather than “g++”, and would have to format the command line appropriately; if your compiler is not in your path, you will have to do something like “c:\full\path\to\compileCobol.exe”.

If you don’t want to also run the program when compiled, then you could just remove the “npp_run …” command from the NppExec script.