Walks you through the process of creating a Visual Studio solution and project for a new PL/I application, and configuring
the project in Visual Studio.
Create the PLIProgram solution and project
A solution is a container holding one or more projects that work together to create an application. The solution has the extension
.sln, and is a readable text file. Microsoft recommends you do not edit the file outside of Visual Studio.
A PL/I project has the extension
.pliproj, and again this is a readable file, but Microsoft recommends that you do not edit it.
- In Visual Studio, click
.
- In the
Create a new project dialog box, select
PL/I from the
Language drop-down list.
- Select the
Console Application template.
- Complete the
Name and
Location fields as follows:
Name
|
PLIProgram
By default, this is the name of both the project and the solution.
|
Location
|
c:\tutorials\PLI
|
Notice that the
Name and
Solution Name fields have the same name. Changing the
Name automatically changes the solution name but changing the solution name does not change the project name.
- Check
Place solution and project in the same directory.
- Click
Create.
Visual Studio opens the
Solution Explorer for the
PLIProgram solution, showing the
PLIProgram project, which contains a newly-created skeleton program,
program1.pli, that is automatically opened in the Visual Studio editor.
Tip: You can export this project to a template on which you can base future projects. To do this:
- On the menu bar click
File >
Export Template.
- Follow the wizard to export the template.
Change the fonts and colors
To change the fonts and colors in which the program is displayed:
- Click
Tools >
Options.
- In the
Options window, expand
Environment and then select
Fonts and Colors.
- The PL/I color items are the following:
- PL/I Comment
- PL/I Margin
- PL/I Margin Text
- PL/I Other Keyword
- PL/I Preprocessor Keyword
- PL/I Reserved Keyword
- PL/I Ruler Numerals
- PL/I Special Character
- PL/I String
Select them in the
Display items list and click
OK to save your settings.
Add the Sub program to the project
To add another PL/I program to the project:
- Right-click the
PLIProgram project in the
Solution Explorer., and then select
Add >
New Item from the context menu.
- In the left pane, click
PL/I Program.
- Change the name to
sub.pli, and then click
Add.
This generates a new skeleton PL/I program file to the project, and opens it in the editor.
View the project and program properties
- In the
Solution Explorer, right-click the
PLIProgram project, and select
Properties on the context menu.
- On the
Properties page, click the different tabs to see what options you can use to configure how your project builds.
- Where appropriate, click
Show Advanced Directives,
, to view more options.
- In the
Solution Explorer, right-click the
program1.pli program, and select
Properties on the context menu to view the program properties
Notes:
- There are
Additional options fields for compiling on the
PL/I tab, and for linking on the
PL/I Link tab.
- On the
PL/I Link tab there is a field for libraries. This is used for both external libraries such as ODBC, and for linking projects. If you
were working on a project that required a
.lib that was created by a second project, you would put the name of that
.lib here and if it is updated by the build process, this project would be re-linked.
- Most of the properties for the project are not duplicated for each program. For example,
-defext is only specified for individual files.
.
Modify
program1.pli
- If
program1.pli is not already open in the Visual Studio editor, double-click
program1.pli in the
Solution Explorer.
- Cut and paste the following code into the program, replacing all existing code:
/* Micro Focus Open PL/I Console Application */
program1: proc options (main);
dcl sub entry;
dcl a1 char(14);
put skip list ('Hello world - main' );
call sub();
put skip;
get list (a1);
end program1;
- Click Save All
.