6.8 Running programs

A compiled program can be run straight from the IDE. This can be done in one of several ways:

1.
select the ”Run—Run” menu, or
2.
press Ctrl-F9.

If command line parameters should be passed to the program, then these can be set through the ”Run—Parameters” menu. The program parameters dialog looks like figure (6.10).



Figure 6.10: The program parameters dialog.

PIC


Once the program has started, it will continue to run, until

1.
the program quits normally,
2.
an error happens,
3.
a breakpoint is encountered, or
4.
the program is reset by the user.

The last alternative is only possible if the program is compiled with debug information.

Alternatively, it is possible to position the cursor somewhere in a source file, and run the program till the execution reaches the source line where the cursor is located. This can be done by

1.
selecting ”Run—Goto Cursor” in the menu,
2.
pressing F4.

Again, this is only possible if the program was compiled with debug information.

The program can also executed line by line. Pressing F8 will execute the next line of the program. If the program wasn’t started yet, it is started. Repeatedly pressing F8 will execute the program line by line, and the IDE will show the line to be executed in an editor window. If somewhere in the code a call occurs to a subroutine, then pressing F8 will cause the whole routine to be executed before control returns to the IDE. If the code of the subroutine should be stepped through as well, then F7 should be used instead. Using F7 will cause the IDE to execute line by line any subroutine that is encountered.

If a subroutine is being stepped through, then the ”Run—Until return” menu will execute the program till the current subroutine ends.

If the program should be stopped before it quits by itself, then this can be done by

1.
selecting ”Run—Program reset” from the menu, or
2.
pressing Ctrl-F2.

The running program will then be aborted.