You are going to add some extra code to your application that will help demonstrate some of the debugging features:
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 configuration uses HelloPLIWorld as the project to run and New_Configuration.bin/HelloPLIWorld.exe (Windows) or New_Configuration.bin/HelloPLIWorld (UNIX) as the main program to run.
You get prompted to switch to the debug perspective. Click Yes to confirm. 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:
You can now step through the code and see how the value of the SourceString changes:
The first line in the program executes and the cursor moves to the next line in the code.
This executes the statement which initializes the value for SourceString.
Debugging stops.
You can save the project for future reference.