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 recompiles the code with your changes.
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.
As you debug, you can watch the value of a data item in the Watch window.
This opens the Watchpoint window below the program editor window.
Enterprise Developer uses the Visual Studio debugger to debug PL/I applications.
Visual Studio builds the program and starts the debugger. The program launches the console window, and then execution stops on DO loop = 1 TO 10 BY 1;.
Notice how the value of SourceString changes.
The debugger runs the program through to the second breakpoint. Notice that the console shows Hello PL/I World!
The debugger closes and returns you to the Visual Studio editor.
This completes the tutorial.