This tutorial demonstrates the basics of how to use Visual Studio to create a simple PL/I application, your first "Hello PL/I World" application.
Create a project
You start by creating a Visual Studio project which is the container for your source code:
- Start
Enterprise Developer.
- Click
File > New > Project.
- Click the
PL/I category in the
Installed > Templates.
- Click
Native and select
Console Application.
- Specify a name for your project such as
HelloPLIWorld and specify a location.
- Uncheck
Create directory for solution and click
OK.
This creates a solution and a project from the available templates in the specified location and opens them in Solution Explorer in Visual Studio.
Add a source file
The IDE creates a project with a template PL/I program. To demonstrate how you add files to a project, you'll delete this template file and add a new one:
- In
Solution Explorer, right-click the template program your project,
Program1.pli and click
Delete. Confirm deletion.
- Right-click your project in
Solution Explorer and click
Add > New Item > PL/I Items, click
PL/I Program, specify a name such as
HelloWorld.pli and click
Add.
This adds a template PL/I file to your project and opens it in the editor.
- Copy and paste the following code into the editor, overwriting the existing text:
HelloWorld: proc options (main);
put skip list("Hello PL/I World!");
end HelloWorld;
- Click
File > Save All.
You can verify now that your project compiles cleanly.
- Click
Build > Build Solution.
The progress of the build is displayed in the
Output view. There should be no errors in the build.
You can now run the application.
Run Hello PL/I world
To run the application:
- From the main menu, click
Debug > Start Without debugging.
This opens a console window with
Hello PL/I World! printed in it.
- Press any key to close the console.
Preserve this project because you are going to use it again for other demonstrations.
What Next?
Continue with the next tutorial,
Debug the Hello PL/I World Application, which demonstrates how to debug PL/I code in Visual Studio.