Here, you modify the code of the original HelloWorld program for the purposes of this demonstration:
DCL SourceString CHAR(10); DCL testchar CHAR; DCL loop FIXED BIN(8); SourceString = "AAbbAAbbCC"; DO loop = 1 TO 10 BY 1; testchar = SUBSTR(SourceString, loop, 1); IF testchar = "A" THEN SUBSTR(SourceString, loop, 1) = "D"; END; PUT SKIP LIST(SourceString); loop = 1; DO WHILE (loop < 10) UNTIL (SUBSTR(SourceString, loop, 1) = "C"); SUBSTR(SourceString, loop, 1) = "Q"; loop = loop + 1; END;
The SourceString variable is a string that has an initial value of AAbbAAbbCC. Some of the string characters are replaced during the execution of this program.
This initiates a rebuild of the project.
Before starting the debugger, set a breakpoint to stop program execution before exiting the console so you can see the output.
DO loop = 1 TO 10 BY 1;
A dot appears in the column to indicate the breakpoint.
end HelloPLIWorld;
Again, a dot appears in the column to indicate the breakpoint.
Enterprise Developer uses the Eclipse debugger to debug PL/I applications.
This configuration uses HelloPLIWorld as the project to run and New_Configuration.bin\HelloPLIWorld.exe as the main program to run.
You are prompted to save and launch before you start debugging.
You are prompted to switch to the debug perspective.
This starts the debugger and it stops on the first line of the program - on the PROC statement.
Some of the views of the Debug perspective you can see are:
The first line in the program executes and the cursor moves to the next line in the code.
This executes the statement that initializes the value for SourceString.
Debugging stops.
This completes the tutorial.