<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.visual-prolog.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=VitalyBuylov</id>
	<title>wiki.visual-prolog.com - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.visual-prolog.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=VitalyBuylov"/>
	<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Special:Contributions/VitalyBuylov"/>
	<updated>2026-04-09T22:46:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:FundamentalVisualPrologBusiness_fig3.png&amp;diff=1223</id>
		<title>File:FundamentalVisualPrologBusiness fig3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:FundamentalVisualPrologBusiness_fig3.png&amp;diff=1223"/>
		<updated>2008-09-30T16:53:46Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: uploaded a new version of &amp;quot;Image:FundamentalVisualPrologBusiness fig3.png&amp;quot;: 7201st3 has changed buttons layout.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Fundamental Visual Prolog - Business 03&lt;br /&gt;
&lt;br /&gt;
{{Tutorial Image}}&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:FundamentalVisualPrologBusiness_fig6.png&amp;diff=1222</id>
		<title>File:FundamentalVisualPrologBusiness fig6.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:FundamentalVisualPrologBusiness_fig6.png&amp;diff=1222"/>
		<updated>2008-09-30T16:51:03Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: uploaded a new version of &amp;quot;Image:FundamentalVisualPrologBusiness fig6.png&amp;quot;: 7201st3 doesn&amp;#039;t have public/private radio button anymore.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Fundamental Visual Prolog - Business 06&lt;br /&gt;
&lt;br /&gt;
{{Tutorial Image}}&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Environment_Overview&amp;diff=1221</id>
		<title>Ide/Environment Overview</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Environment_Overview&amp;diff=1221"/>
		<updated>2008-09-30T16:45:00Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial I will give an overview of the Integrated Development Environment (IDE).The IDE is used to create, develop and maintain your Visual Prolog projects.&lt;br /&gt;
&lt;br /&gt;
Briefly speaking you will use the IDE for the following tasks in a project life cycle:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Creation&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;The project is created in the IDE, at creation time you choose important properties of your project, such as whether the project is an executable or a DLL, whether it uses GUI or is text based, etc.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Building&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;The project is built, i.e. compiled and linked, from the IDE.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Browsing&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;The IDE and the compiler collect information about the project, which is utilized in various ways for quick localization of entities, etc.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Development&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;During the development and maintenance of the project, the IDE is used to add and remove source files and GUI entities to the project and to edit these.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Debugging&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;The IDE is also used for debugging the project. The debugger is used to follow program execution and exploit the program state when the program runs.In the sequel we will look more detailed at each of these things.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that the tutorial will start from scratch and create a project that is used for the whole tutorial. The reader is encouraged to do the same. Also notice that clicking on reduced pictures will show them in full scale in a separate window.&lt;br /&gt;
&lt;br /&gt;
==Creation==&lt;br /&gt;
&lt;br /&gt;
First we will create a project by selecting &amp;#039;&amp;#039;&amp;#039;Project -&amp;gt; New...&amp;#039;&amp;#039;&amp;#039; in the menu. In response to this you are presented to a dialog containing various properties of the project.&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectSettingsS.png]]&lt;br /&gt;
&lt;br /&gt;
I have chosen that my project should have the name &amp;#039;&amp;#039;tut01&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The project name is also used as the name of the target that is produced.  In this case the target is an &amp;#039;&amp;#039;exe&amp;#039;&amp;#039; file so the target name will be &amp;#039;&amp;#039;tut01.exe&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
I have also chosen that the target should be a GUI program, i.e. a program with a graphical user interface.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Base Directory&amp;#039;&amp;#039;&amp;#039; is the &amp;quot;base&amp;quot; of all your projects; you should choose a place that is convenient for you.&lt;br /&gt;
&lt;br /&gt;
The new project will be created in a &amp;#039;&amp;#039;&amp;#039;Sub-Directory&amp;#039;&amp;#039;&amp;#039; of the base directory. By default this directory have the same name as the project itself.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Package Prefix&amp;#039;&amp;#039;&amp;#039; is used when creating new &amp;quot;packages&amp;quot; in the system (a later tutorial will explain about the package notion). In case your source files will ever be shared with somebody else it is a good idea if the prefix does not conflict with other prefixes. Therefore it is a good idea to use a prefix that start with a reverse Internet domain name, like &amp;#039;&amp;#039;com/visual-prolog &amp;#039;&amp;#039;(which is the reverse of &amp;#039;&amp;#039;visual-prolog.com&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
For the moment you do not need to consider the remaining tabs and options.&lt;br /&gt;
&lt;br /&gt;
Now create the project by pressing &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The IDE will now look something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_totalS.png]] [[Image:tut01_message.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To the left you have the &amp;#039;&amp;#039;&amp;#039;Project Window&amp;#039;&amp;#039;&amp;#039;, which contains information about the entities in your project. Right now there is not very much information, but once we compile the project information will be added. We will explore this window more when we have compiled the project.&lt;br /&gt;
&lt;br /&gt;
To the right/bottom you have the &amp;#039;&amp;#039;&amp;#039;Messages Window&amp;#039;&amp;#039;&amp;#039;, which will contain various status and progress messages.&lt;br /&gt;
&lt;br /&gt;
==Building==&lt;br /&gt;
&lt;br /&gt;
Before we make any modifications, we will build (i.e. compile and link) the project. In the &amp;#039;&amp;#039;&amp;#039;Build&amp;#039;&amp;#039;&amp;#039; menu you find commands for building, compiling and executing the project.&lt;br /&gt;
&lt;br /&gt;
If you choose &amp;#039;&amp;#039;&amp;#039;Execute&amp;#039;&amp;#039;&amp;#039; the project is first build, so that it is an up to date version you execute. Therefore I will choose &amp;#039;&amp;#039;&amp;#039;Execute&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
If you have not registered Visual Prolog you will be presented to a special screen telling you so. I will suggest that you register, but you can also choose &amp;quot;Continue Evaluation&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the &amp;#039;&amp;#039;&amp;#039;Messages Window&amp;#039;&amp;#039;&amp;#039; the IDE writes which files are compiled, etc.&lt;br /&gt;
&lt;br /&gt;
If the build process succeeds, which it does in this case, the created program is executed. As a result you will see a little &amp;#039;&amp;#039;doing-nothing &amp;#039;&amp;#039;GUI program. You might notice that the program looks a bit like the IDE itself. This is no coincidence since the IDE is actually a Visual Prolog program.&lt;br /&gt;
&lt;br /&gt;
Later in this tutorial we will also see what happens, if the compiler or the linker detects errors in the build process.&lt;br /&gt;
&lt;br /&gt;
==Browsing==&lt;br /&gt;
&lt;br /&gt;
Right now we will turn our eyes to the &amp;#039;&amp;#039;&amp;#039;Project Tree&amp;#039;&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;&amp;#039;Project Window&amp;#039;&amp;#039;&amp;#039;, and explore that a bit. The tree itself is presented in a standard Windows tree control so you should already be familiar with its usage. Here we shall concentrate on the contents of the tree.&lt;br /&gt;
&lt;br /&gt;
Right now the project tree will look like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectWindow1.png|Project Tree]]&lt;br /&gt;
&lt;br /&gt;
The top node represents the project, and the project directory.&lt;br /&gt;
&lt;br /&gt;
Right below that is the logical node &amp;#039;&amp;#039;&amp;#039;$(ProDir)&amp;#039;&amp;#039;&amp;#039; which represents the directory in which Visual Prolog is installed. This directory contains (as we shall shortly see) libraries and library code from the Visual Prolog system.&lt;br /&gt;
&lt;br /&gt;
Then comes another directory &amp;#039;&amp;#039;&amp;#039;TaskWindow,&amp;#039;&amp;#039;&amp;#039; which is a subdirectory of the project directory. This directory contains all the code needed to produce the Task Window, its menu and toolbar and the about dialog.&lt;br /&gt;
&lt;br /&gt;
Finally, you see a number of files. Visual Prolog uses the following conventions:&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;ph&amp;#039;&amp;#039;&amp;#039; files are &amp;#039;&amp;#039;&amp;#039;package headers&amp;#039;&amp;#039;&amp;#039;. A package is a collection of classes and interfaces that are intended to be used as a chunk.&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;pack&amp;#039;&amp;#039;&amp;#039; files are &amp;#039;&amp;#039;&amp;#039;packages&amp;#039;&amp;#039;&amp;#039;. They contain the implementation/definition of the corresponding .ph files.&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;i&amp;#039;&amp;#039;&amp;#039; file contains an &amp;#039;&amp;#039;&amp;#039;interface&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;cl&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;class declaration&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;pro&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;class implementation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you expand the main.cl node completely you will see the following:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectWindow2.png|Project Tree]]&lt;br /&gt;
&lt;br /&gt;
This sub-tree shows that the file &amp;#039;&amp;#039;&amp;#039;main.cl&amp;#039;&amp;#039;&amp;#039; contains a class called &amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;, which contains two predicates called classinfo and run respectively.  Predicates are subroutines, but they will not be considered further in this tutorial.&lt;br /&gt;
&lt;br /&gt;
If we collapse this node again and instead expand the &amp;#039;&amp;#039;&amp;#039;TaskWindow&amp;#039;&amp;#039;&amp;#039; node, you will see this tree:&lt;br /&gt;
&lt;br /&gt;
You will notice several new kinds of nodes:&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;dlg&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;dialog&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;frm&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;form&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;win&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;window&amp;#039;&amp;#039;&amp;#039; (task window or conventional PFC GUI window)&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;mnu&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;ico&amp;#039;&amp;#039;&amp;#039; file contains an &amp;#039;&amp;#039;&amp;#039;icon&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you continue to explore you might also meet:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectWindow3.png|Project Tree: TaskWindow]]&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;ctl&amp;#039;&amp;#039;&amp;#039; files containing &amp;#039;&amp;#039;&amp;#039;controls&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;tb&amp;#039;&amp;#039;&amp;#039; files containing &amp;#039;&amp;#039;&amp;#039;toolbars&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;cur&amp;#039;&amp;#039;&amp;#039; files containing &amp;#039;&amp;#039;&amp;#039;cursors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;bmp&amp;#039;&amp;#039;&amp;#039; files containing &amp;#039;&amp;#039;&amp;#039;bitmaps&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;lib&amp;#039;&amp;#039;&amp;#039; that are &amp;#039;&amp;#039;&amp;#039;libraries&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you right click on a node a context menu will appear, with commands that have relevance for that particular node.&lt;br /&gt;
&lt;br /&gt;
If you double click on a node the corresponding entity will be brought up in a suitable editor. All code is edited in a text editor, but windows resources like dialogs and menus are edited in graphical editors. We will look closer to graphical editors below, here we shall try to bring up a text editor.&lt;br /&gt;
&lt;br /&gt;
Some entities are represented twice in the tree, because they have both a declaration and a definition/implementation. For example, the predicate run in the class &amp;#039;&amp;#039;&amp;#039;tut01&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectWindow2.png|Project Tree]] [[Image:tut01_projectWindow4.png|Project Tree]]&lt;br /&gt;
&lt;br /&gt;
Try double clicking on each of the run nodes, and notice that two editors open showing the declaration and the definition of the run predicate, respectively.&lt;br /&gt;
&lt;br /&gt;
The IDE has other facilities for browsing to specific entities, but these will not be considered here.&lt;br /&gt;
&lt;br /&gt;
==Development==&lt;br /&gt;
&lt;br /&gt;
Now lets try to modify the project a bit. Since we have not yet concerned ourselves with how to program in Visual Prolog, we will keep the changes simple.&lt;br /&gt;
&lt;br /&gt;
We will start by deliberately introducing an error, that way you will not be completely surprised if you make some thing wrong, at the same time you can see the error window.&lt;br /&gt;
&lt;br /&gt;
First you should locate the clauses for the run predicate in the file &amp;#039;&amp;#039;&amp;#039;main.pro&amp;#039;&amp;#039;&amp;#039;. If you double click the last of the two run nodes in the project tree, an editor opens with the caret placed like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_editRun1S.png]]&lt;br /&gt;
&lt;br /&gt;
Try inserting a fail like this (notice the comma after show):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        TaskWindow = taskWindow::new(),&lt;br /&gt;
        TaskWindow:show(),&lt;br /&gt;
        fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that we try to build the project again: simply press the &amp;#039;&amp;#039;&amp;#039;Ctrl+Shift+B&amp;#039;&amp;#039;&amp;#039; key combination. The system will now save and compile the file, but since we have made an error, the &amp;#039;&amp;#039;&amp;#039;Error Window&amp;#039;&amp;#039;&amp;#039; will open:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_errorS.png|Error Wondow]]&lt;br /&gt;
&lt;br /&gt;
We will consider what the error message actually means. Instead you should try to double-click on the error message. You will notice that the editor gets focus again and that the caret points exactly to the fail we inserted.&lt;br /&gt;
&lt;br /&gt;
Reestablish the code without the fail and build the project again.&lt;br /&gt;
&lt;br /&gt;
Next we will try to make a modification in the about dialog. It is not a very sensible change, but it will illustrate a number of things.&lt;br /&gt;
&lt;br /&gt;
First we will open the &amp;#039;&amp;#039;&amp;#039;About&amp;#039;&amp;#039;&amp;#039; dialog in the &amp;#039;&amp;#039;&amp;#039;Dialog Editor&amp;#039;&amp;#039;&amp;#039;, to do this you double click the dialog in the project tree. The node you have to double click is shown here:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectWindowAbout.png|Project Window: About Dialog]]&lt;br /&gt;
&lt;br /&gt;
Once you have clicked it you will see the dialog in the &amp;#039;&amp;#039;&amp;#039;Dialog Editor&amp;#039;&amp;#039;&amp;#039;, two toolbars and properties window.&lt;br /&gt;
&lt;br /&gt;
We will add a button to the dialog. You click on the &amp;quot;button&amp;quot; on the controls toolbar, and then you click in the dialog next to the project icon in the &amp;#039;&amp;#039;&amp;#039;AboutDialog&amp;#039;&amp;#039;&amp;#039; window. As a result you can see the properties of the new control and you can edit them. I have changed the &amp;#039;&amp;#039;&amp;#039;Text&amp;#039;&amp;#039;&amp;#039; to &amp;quot;Press Me&amp;quot;, this is the text that will appear on the button. I can also see the &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; field, the IDE will identify this particular control in various contexts by this Name.&lt;br /&gt;
&lt;br /&gt;
Now it should look something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_dialogEditorAbout2.png|Dialog Editor: About Dialog with new button]]&lt;br /&gt;
&lt;br /&gt;
Now we want to do something whenever the button is pressed. To do this we will open the &amp;#039;&amp;#039;&amp;#039;Code Expert&amp;#039;&amp;#039;&amp;#039;: Right click the dialog and select &amp;#039;&amp;#039;&amp;#039;Code Expert&amp;#039;&amp;#039;&amp;#039;. The code expert will open and I have located my button.&lt;br /&gt;
&lt;br /&gt;
The blue dot indicates that the control is not handled. The IDE has suggested the name onPushButton for the handling predicate. We will choose &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; to add this predicate to our code and to bind it to this control.&lt;br /&gt;
&lt;br /&gt;
If you double-click the line corresponding to the control in the code expert, an editor will open positioned at the newly inserted code.&lt;br /&gt;
&lt;br /&gt;
We will change the button text when the button is pressed. To do this we modify the code as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    onPushButtonClick : button::clickResponder.&lt;br /&gt;
clauses&lt;br /&gt;
    onPushButtonClick(_Source) = button::defaultAction() :-&lt;br /&gt;
        pushButton_ctl:setText(&amp;quot;Pressed&amp;quot;).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try to build and execute the program again (i.e. press the &amp;#039;&amp;#039;&amp;#039;Ctrl+Shift+B&amp;#039;&amp;#039;&amp;#039; key combination).  If you have followed the steps carefully this should be a success. In the program you should of course open the &amp;#039;&amp;#039;&amp;#039;About&amp;#039;&amp;#039;&amp;#039; dialog, by selecting the menu entry &amp;#039;&amp;#039;&amp;#039;Help -&amp;gt; About&amp;#039;&amp;#039;&amp;#039;; and then press the new button.&lt;br /&gt;
&lt;br /&gt;
This is how it looked in my application:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_AboutPressMe.png|About: Press Me]][[Image:tut01_AboutPressed.png|About Pressed]]&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
The development environment contains a debugger. With the debugger you can trace the execution of your program and examine the program state.&lt;br /&gt;
&lt;br /&gt;
It does not make much sense to go into details with debugging before you have learned the Visual Prolog language. But I will briefly explain the debugger anyway, because it can be very useful for understanding and experimenting with the language.&lt;br /&gt;
&lt;br /&gt;
To start the debugger, select &amp;#039;&amp;#039;&amp;#039;Debug -&amp;gt; Run&amp;#039;&amp;#039;&amp;#039; in the menu.  If the project is not up-to-date it will first be build, after that the debugging session will start.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; you can stop the debugging at any time by selecting &amp;#039;&amp;#039;&amp;#039;Debug -&amp;gt; Stop Debugging&amp;#039;&amp;#039;&amp;#039; in the menu.&lt;br /&gt;
&lt;br /&gt;
When debugging starts the IDE will first load the debug information and then it will enter the program. The program execution is stopped just before the goal is executed. To indicate this, the goal is opened in an editor window, and the blue arrow points to the goal:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_debug1.png|Editor: Current Position]]&lt;br /&gt;
&lt;br /&gt;
You can single step in the program using the &amp;#039;&amp;#039;&amp;#039;Step Into &amp;#039;&amp;#039;&amp;#039;and &amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; commands in the &amp;#039;&amp;#039;&amp;#039;Debug &amp;#039;&amp;#039;&amp;#039;menu.&lt;br /&gt;
&lt;br /&gt;
Try &amp;#039;&amp;#039;&amp;#039;Step Into&amp;#039;&amp;#039;&amp;#039;: this will open another editor with the code of mainExe::run, and the arrow will point to the entry of this code.&lt;br /&gt;
&lt;br /&gt;
In the view menu you can open various debugger windows, which I will briefly explain.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_runStack.png|Run Stack]]&lt;br /&gt;
&lt;br /&gt;
contains a &amp;quot;picture&amp;quot; of the run stack. Exactly what you see depends on your settings in &amp;#039;&amp;#039;&amp;#039;Tools -&amp;gt; Options... -&amp;gt; Debugger&amp;#039;&amp;#039;&amp;#039;.  In principle, the run stack contains a number of lines corresponding to calls that has been made. However, optimization (so called last call optimization) might have removed some entries.&lt;br /&gt;
&lt;br /&gt;
The run stack not only shows the calls, it also shows trap points and backtrack points, these is described in a later tutorial and there I also describe the run stack window in more details.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Local Variables&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_localVariables.png|Local Variables]]&lt;br /&gt;
&lt;br /&gt;
contains the local variables corresponding to the selection in the run stack window. Some variables might not yet have received a value, these are show as an underscore (i.e. like originalraiser in the above picture).&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_factsWindow.png|Facts]]&lt;br /&gt;
&lt;br /&gt;
Contains the global state of the program, this state is stored in fact databases. &amp;#039;&amp;#039;Fact databases &amp;#039;&amp;#039;are a unique Visual Prolog feature, which will be described in a later tutorial. You can also add objects from the &amp;#039;&amp;#039;&amp;#039;Local Variables &amp;#039;&amp;#039;&amp;#039;window to the &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window, that way you can track the state changes in interesting objects.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints &amp;#039;&amp;#039;&amp;#039;window:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_breakPointsWindow.png]]&lt;br /&gt;
&lt;br /&gt;
shows the current breakpoints in the program (I have set open breakpoint so that the window would not be empty). You can set/remove breakpoints by selecting &amp;#039;&amp;#039;&amp;#039;Debug -&amp;gt; Toggle Breakpoint&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The remaining debug windows are for low level debugging and will not be considered here.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
The Integrated Development Environment (IDE) makes it possible for you to:&lt;br /&gt;
&lt;br /&gt;
*create&lt;br /&gt;
&lt;br /&gt;
*build&lt;br /&gt;
&lt;br /&gt;
*maintain, and&lt;br /&gt;
&lt;br /&gt;
*debug&lt;br /&gt;
&lt;br /&gt;
your projects. It contains a number of tools, editor and wizards that will help you in your tasks.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
*[[IDE Key Bindings]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Среда_разработки]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:IDE]]&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Environment_Overview&amp;diff=1220</id>
		<title>Ide/Environment Overview</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Environment_Overview&amp;diff=1220"/>
		<updated>2008-09-30T16:43:32Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial I will give an overview of the Integrated Development Environment (IDE).The IDE is used to create, develop and maintain your Visual Prolog projects.&lt;br /&gt;
&lt;br /&gt;
Briefly speaking you will use the IDE for the following tasks in a project life cycle:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Creation&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;The project is created in the IDE, at creation time you choose important properties of your project, such as whether the project is an executable or a DLL, whether it uses GUI or is text based, etc.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Building&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;The project is built, i.e. compiled and linked, from the IDE.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Browsing&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;The IDE and the compiler collect information about the project, which is utilized in various ways for quick localization of entities, etc.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Development&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;During the development and maintenance of the project, the IDE is used to add and remove source files and GUI entities to the project and to edit these.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Debugging&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;The IDE is also used for debugging the project. The debugger is used to follow program execution and exploit the program state when the program runs.In the sequel we will look more detailed at each of these things.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; that the tutorial will start from scratch and create a project that is used for the whole tutorial. The reader is encouraged to do the same. Also notice that clicking on reduced pictures will show them in full scale in a separate window.&lt;br /&gt;
&lt;br /&gt;
==Creation==&lt;br /&gt;
&lt;br /&gt;
First we will create a project by selecting &amp;#039;&amp;#039;&amp;#039;Project -&amp;gt; New...&amp;#039;&amp;#039;&amp;#039; in the menu. In response to this you are presented to a dialog containing various properties of the project.&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectSettingsS.png]]&lt;br /&gt;
&lt;br /&gt;
I have chosen that my project should have the name &amp;#039;&amp;#039;tut01&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The project name is also used as the name of the target that is produced.  In this case the target is an &amp;#039;&amp;#039;exe&amp;#039;&amp;#039; file so the target name will be &amp;#039;&amp;#039;tut01.exe&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
I have also chosen that the target should be a GUI program, i.e. a program with a graphical user interface.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Base Directory&amp;#039;&amp;#039;&amp;#039; is the &amp;quot;base&amp;quot; of all your projects; you should choose a place that is convenient for you.&lt;br /&gt;
&lt;br /&gt;
The new project will be created in a &amp;#039;&amp;#039;&amp;#039;Sub-Directory&amp;#039;&amp;#039;&amp;#039; of the base directory. By default this directory have the same name as the project itself.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Package Prefix&amp;#039;&amp;#039;&amp;#039; is used when creating new &amp;quot;packages&amp;quot; in the system (a later tutorial will explain about the package notion). In case your source files will ever be shared with somebody else it is a good idea if the prefix does not conflict with other prefixes. Therefore it is a good idea to use a prefix that start with a reverse Internet domain name, like &amp;#039;&amp;#039;com/visual-prolog &amp;#039;&amp;#039;(which is the reverse of &amp;#039;&amp;#039;visual-prolog.com&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
For the moment you do not need to consider the remaining tabs and options.&lt;br /&gt;
&lt;br /&gt;
Now create the project by pressing &amp;#039;&amp;#039;&amp;#039;OK&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The IDE will now look something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_totalS.png]] [[Image:tut01_message.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To the left you have the &amp;#039;&amp;#039;&amp;#039;Project Window&amp;#039;&amp;#039;&amp;#039;, which contains information about the entities in your project. Right now there is not very much information, but once we compile the project information will be added. We will explore this window more when we have compiled the project.&lt;br /&gt;
&lt;br /&gt;
To the right/bottom you have the &amp;#039;&amp;#039;&amp;#039;Messages Window&amp;#039;&amp;#039;&amp;#039;, which will contain various status and progress messages.&lt;br /&gt;
&lt;br /&gt;
==Building==&lt;br /&gt;
&lt;br /&gt;
Before we make any modifications, we will build (i.e. compile and link) the project. In the &amp;#039;&amp;#039;&amp;#039;Build&amp;#039;&amp;#039;&amp;#039; menu you find commands for building, compiling and executing the project.&lt;br /&gt;
&lt;br /&gt;
If you choose &amp;#039;&amp;#039;&amp;#039;Execute&amp;#039;&amp;#039;&amp;#039; the project is first build, so that it is an up to date version you execute. Therefore I will choose &amp;#039;&amp;#039;&amp;#039;Execute&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
If you have not registered Visual Prolog you will be presented to a special screen telling you so. I will suggest that you register, but you can also choose &amp;quot;Continue Evaluation&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the &amp;#039;&amp;#039;&amp;#039;Messages Window&amp;#039;&amp;#039;&amp;#039; the IDE writes which files are compiled, etc.&lt;br /&gt;
&lt;br /&gt;
If the build process succeeds, which it does in this case, the created program is executed. As a result you will see a little &amp;#039;&amp;#039;doing-nothing &amp;#039;&amp;#039;GUI program. You might notice that the program looks a bit like the IDE itself. This is no coincidence since the IDE is actually a Visual Prolog program.&lt;br /&gt;
&lt;br /&gt;
Later in this tutorial we will also see what happens, if the compiler or the linker detects errors in the build process.&lt;br /&gt;
&lt;br /&gt;
==Browsing==&lt;br /&gt;
&lt;br /&gt;
Right now we will turn our eyes to the &amp;#039;&amp;#039;&amp;#039;Project Tree&amp;#039;&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;&amp;#039;Project Window&amp;#039;&amp;#039;&amp;#039;, and explore that a bit. The tree itself is presented in a standard Windows tree control so you should already be familiar with its usage. Here we shall concentrate on the contents of the tree.&lt;br /&gt;
&lt;br /&gt;
Right now the project tree will look like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectWindow1.png|Project Tree]]&lt;br /&gt;
&lt;br /&gt;
The top node represents the project, and the project directory.&lt;br /&gt;
&lt;br /&gt;
Right below that is the logical node &amp;#039;&amp;#039;&amp;#039;$(ProDir)&amp;#039;&amp;#039;&amp;#039; which represents the directory in which Visual Prolog is installed. This directory contains (as we shall shortly see) libraries and library code from the Visual Prolog system.&lt;br /&gt;
&lt;br /&gt;
Then comes another directory &amp;#039;&amp;#039;&amp;#039;TaskWindow,&amp;#039;&amp;#039;&amp;#039; which is a subdirectory of the project directory. This directory contains all the code needed to produce the Task Window, its menu and toolbar and the about dialog.&lt;br /&gt;
&lt;br /&gt;
Finally, you see a number of files. Visual Prolog uses the following conventions:&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;ph&amp;#039;&amp;#039;&amp;#039; files are &amp;#039;&amp;#039;&amp;#039;package headers&amp;#039;&amp;#039;&amp;#039;. A package is a collection of classes and interfaces that are intended to be used as a chunk.&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;pack&amp;#039;&amp;#039;&amp;#039; files are &amp;#039;&amp;#039;&amp;#039;packages&amp;#039;&amp;#039;&amp;#039;. They contain the implementation/definition of the corresponding .ph files.&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;i&amp;#039;&amp;#039;&amp;#039; file contains an &amp;#039;&amp;#039;&amp;#039;interface&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;cl&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;class declaration&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;pro&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;class implementation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you expand the main.cl node completely you will see the following:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectWindow2.png|Project Tree]]&lt;br /&gt;
&lt;br /&gt;
This sub-tree shows that the file &amp;#039;&amp;#039;&amp;#039;main.cl&amp;#039;&amp;#039;&amp;#039; contains a class called &amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;, which contains two predicates called classinfo and run respectively.  Predicates are subroutines, but they will not be considered further in this tutorial.&lt;br /&gt;
&lt;br /&gt;
If we collapse this node again and instead expand the &amp;#039;&amp;#039;&amp;#039;TaskWindow&amp;#039;&amp;#039;&amp;#039; node, you will see this tree:&lt;br /&gt;
&lt;br /&gt;
You will notice several new kinds of nodes:&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;dlg&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;dialog&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;frm&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;form&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;win&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;window&amp;#039;&amp;#039;&amp;#039; (task window or conventional PFC GUI window)&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;mnu&amp;#039;&amp;#039;&amp;#039; file contains a &amp;#039;&amp;#039;&amp;#039;menu&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;ico&amp;#039;&amp;#039;&amp;#039; file contains an &amp;#039;&amp;#039;&amp;#039;icon&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you continue to explore you might also meet:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectWindow3.png|Project Tree: TaskWindow]]&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;ctl&amp;#039;&amp;#039;&amp;#039; files containing &amp;#039;&amp;#039;&amp;#039;controls&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;tb&amp;#039;&amp;#039;&amp;#039; files containing &amp;#039;&amp;#039;&amp;#039;toolbars&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;cur&amp;#039;&amp;#039;&amp;#039; files containing &amp;#039;&amp;#039;&amp;#039;cursors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;bmp&amp;#039;&amp;#039;&amp;#039; files containing &amp;#039;&amp;#039;&amp;#039;bitmaps&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*.&amp;#039;&amp;#039;&amp;#039;lib&amp;#039;&amp;#039;&amp;#039; that are &amp;#039;&amp;#039;&amp;#039;libraries&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you right click on a node a context menu will appear, with commands that have relevance for that particular node.&lt;br /&gt;
&lt;br /&gt;
If you double click on a node the corresponding entity will be brought up in a suitable editor. All code is edited in a text editor, but windows resources like dialogs and menus are edited in graphical editors. We will look closer to graphical editors below, here we shall try to bring up a text editor.&lt;br /&gt;
&lt;br /&gt;
Some entities are represented twice in the tree, because they have both a declaration and a definition/implementation. For example, the predicate run in the class &amp;#039;&amp;#039;&amp;#039;tut01&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectWindow2.png|Project Tree]] [[Image:tut01_projectWindow4.png|Project Tree]]&lt;br /&gt;
&lt;br /&gt;
Try double clicking on each of the run nodes, and notice that two editors open showing the declaration and the definition of the run predicate, respectively.&lt;br /&gt;
&lt;br /&gt;
The IDE has other facilities for browsing to specific entities, but these will not be considered here.&lt;br /&gt;
&lt;br /&gt;
==Development==&lt;br /&gt;
&lt;br /&gt;
Now lets try to modify the project a bit. Since we have not yet concerned ourselves with how to program in Visual Prolog, we will keep the changes simple.&lt;br /&gt;
&lt;br /&gt;
We will start by deliberately introducing an error, that way you will not be completely surprised if you make some thing wrong, at the same time you can see the error window.&lt;br /&gt;
&lt;br /&gt;
First you should locate the clauses for the run predicate in the file &amp;#039;&amp;#039;&amp;#039;main.pro&amp;#039;&amp;#039;&amp;#039;. If you double click the last of the two run nodes in the project tree, an editor opens with the caret placed like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_editRun1S.png]]&lt;br /&gt;
&lt;br /&gt;
Try inserting a fail like this (notice the comma after show):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        TaskWindow = taskWindow::new(),&lt;br /&gt;
        TaskWindow:show(),&lt;br /&gt;
        fail.&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that we try to build the project again: simply press the &amp;#039;&amp;#039;&amp;#039;Ctrl-Shift-B&amp;#039;&amp;#039;&amp;#039; key combination. The system will now save and compile the file, but since we have made an error, the &amp;#039;&amp;#039;&amp;#039;Error Window&amp;#039;&amp;#039;&amp;#039; will open:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_errorS.png|Error Wondow]]&lt;br /&gt;
&lt;br /&gt;
We will consider what the error message actually means. Instead you should try to double-click on the error message. You will notice that the editor gets focus again and that the caret points exactly to the fail we inserted.&lt;br /&gt;
&lt;br /&gt;
Reestablish the code without the fail and build the project again.&lt;br /&gt;
&lt;br /&gt;
Next we will try to make a modification in the about dialog. It is not a very sensible change, but it will illustrate a number of things.&lt;br /&gt;
&lt;br /&gt;
First we will open the &amp;#039;&amp;#039;&amp;#039;About&amp;#039;&amp;#039;&amp;#039; dialog in the &amp;#039;&amp;#039;&amp;#039;Dialog Editor&amp;#039;&amp;#039;&amp;#039;, to do this you double click the dialog in the project tree. The node you have to double click is shown here:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_projectWindowAbout.png|Project Window: About Dialog]]&lt;br /&gt;
&lt;br /&gt;
Once you have clicked it you will see the dialog in the &amp;#039;&amp;#039;&amp;#039;Dialog Editor&amp;#039;&amp;#039;&amp;#039;, two toolbars and properties window.&lt;br /&gt;
&lt;br /&gt;
We will add a button to the dialog. You click on the &amp;quot;button&amp;quot; on the controls toolbar, and then you click in the dialog next to the project icon in the &amp;#039;&amp;#039;&amp;#039;AboutDialog&amp;#039;&amp;#039;&amp;#039; window. As a result you can see the properties of the new control and you can edit them. I have changed the &amp;#039;&amp;#039;&amp;#039;Text&amp;#039;&amp;#039;&amp;#039; to &amp;quot;Press Me&amp;quot;, this is the text that will appear on the button. I can also see the &amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039; field, the IDE will identify this particular control in various contexts by this Name.&lt;br /&gt;
&lt;br /&gt;
Now it should look something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_dialogEditorAbout2.png|Dialog Editor: About Dialog with new button]]&lt;br /&gt;
&lt;br /&gt;
Now we want to do something whenever the button is pressed. To do this we will open the &amp;#039;&amp;#039;&amp;#039;Code Expert&amp;#039;&amp;#039;&amp;#039;: Right click the dialog and select &amp;#039;&amp;#039;&amp;#039;Code Expert&amp;#039;&amp;#039;&amp;#039;. The code expert will open and I have located my button.&lt;br /&gt;
&lt;br /&gt;
The blue dot indicates that the control is not handled. The IDE has suggested the name onPushButton for the handling predicate. We will choose &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; to add this predicate to our code and to bind it to this control.&lt;br /&gt;
&lt;br /&gt;
If you double-click the line corresponding to the control in the code expert, an editor will open positioned at the newly inserted code.&lt;br /&gt;
&lt;br /&gt;
We will change the button text when the button is pressed. To do this we modify the code as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    onPushButtonClick : button::clickResponder.&lt;br /&gt;
clauses&lt;br /&gt;
    onPushButtonClick(_Source) = button::defaultAction() :-&lt;br /&gt;
        pushButton_ctl:setText(&amp;quot;Pressed&amp;quot;).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try to build and execute the program again (i.e. press the &amp;#039;&amp;#039;&amp;#039;Ctrl-Shift-B&amp;#039;&amp;#039;&amp;#039; key combination).  If you have followed the steps carefully this should be a success. In the program you should of course open the &amp;#039;&amp;#039;&amp;#039;About&amp;#039;&amp;#039;&amp;#039; dialog, by selecting the menu entry &amp;#039;&amp;#039;&amp;#039;Help -&amp;gt; About&amp;#039;&amp;#039;&amp;#039;; and then press the new button.&lt;br /&gt;
&lt;br /&gt;
This is how it looked in my application:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_AboutPressMe.png|About: Press Me]][[Image:tut01_AboutPressed.png|About Pressed]]&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
The development environment contains a debugger. With the debugger you can trace the execution of your program and examine the program state.&lt;br /&gt;
&lt;br /&gt;
It does not make much sense to go into details with debugging before you have learned the Visual Prolog language. But I will briefly explain the debugger anyway, because it can be very useful for understanding and experimenting with the language.&lt;br /&gt;
&lt;br /&gt;
To start the debugger, select &amp;#039;&amp;#039;&amp;#039;Debug -&amp;gt; Run&amp;#039;&amp;#039;&amp;#039; in the menu.  If the project is not up-to-date it will first be build, after that the debugging session will start.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notice&amp;#039;&amp;#039;&amp;#039; you can stop the debugging at any time by selecting &amp;#039;&amp;#039;&amp;#039;Debug -&amp;gt; Stop Debugging&amp;#039;&amp;#039;&amp;#039; in the menu.&lt;br /&gt;
&lt;br /&gt;
When debugging starts the IDE will first load the debug information and then it will enter the program. The program execution is stopped just before the goal is executed. To indicate this, the goal is opened in an editor window, and the blue arrow points to the goal:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_debug1.png|Editor: Current Position]]&lt;br /&gt;
&lt;br /&gt;
You can single step in the program using the &amp;#039;&amp;#039;&amp;#039;Step Into &amp;#039;&amp;#039;&amp;#039;and &amp;#039;&amp;#039;&amp;#039;Step Over&amp;#039;&amp;#039;&amp;#039; commands in the &amp;#039;&amp;#039;&amp;#039;Debug &amp;#039;&amp;#039;&amp;#039;menu.&lt;br /&gt;
&lt;br /&gt;
Try &amp;#039;&amp;#039;&amp;#039;Step Into&amp;#039;&amp;#039;&amp;#039;: this will open another editor with the code of mainExe::run, and the arrow will point to the entry of this code.&lt;br /&gt;
&lt;br /&gt;
In the view menu you can open various debugger windows, which I will briefly explain.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Run Stack&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_runStack.png|Run Stack]]&lt;br /&gt;
&lt;br /&gt;
contains a &amp;quot;picture&amp;quot; of the run stack. Exactly what you see depends on your settings in &amp;#039;&amp;#039;&amp;#039;Tools -&amp;gt; Options... -&amp;gt; Debugger&amp;#039;&amp;#039;&amp;#039;.  In principle, the run stack contains a number of lines corresponding to calls that has been made. However, optimization (so called last call optimization) might have removed some entries.&lt;br /&gt;
&lt;br /&gt;
The run stack not only shows the calls, it also shows trap points and backtrack points, these is described in a later tutorial and there I also describe the run stack window in more details.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Local Variables&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_localVariables.png|Local Variables]]&lt;br /&gt;
&lt;br /&gt;
contains the local variables corresponding to the selection in the run stack window. Some variables might not yet have received a value, these are show as an underscore (i.e. like originalraiser in the above picture).&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_factsWindow.png|Facts]]&lt;br /&gt;
&lt;br /&gt;
Contains the global state of the program, this state is stored in fact databases. &amp;#039;&amp;#039;Fact databases &amp;#039;&amp;#039;are a unique Visual Prolog feature, which will be described in a later tutorial. You can also add objects from the &amp;#039;&amp;#039;&amp;#039;Local Variables &amp;#039;&amp;#039;&amp;#039;window to the &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; window, that way you can track the state changes in interesting objects.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Breakpoints &amp;#039;&amp;#039;&amp;#039;window:&lt;br /&gt;
&lt;br /&gt;
[[Image:tut01_breakPointsWindow.png]]&lt;br /&gt;
&lt;br /&gt;
shows the current breakpoints in the program (I have set open breakpoint so that the window would not be empty). You can set/remove breakpoints by selecting &amp;#039;&amp;#039;&amp;#039;Debug -&amp;gt; Toggle Breakpoint&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The remaining debug windows are for low level debugging and will not be considered here.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
The Integrated Development Environment (IDE) makes it possible for you to:&lt;br /&gt;
&lt;br /&gt;
*create&lt;br /&gt;
&lt;br /&gt;
*build&lt;br /&gt;
&lt;br /&gt;
*maintain, and&lt;br /&gt;
&lt;br /&gt;
*debug&lt;br /&gt;
&lt;br /&gt;
your projects. It contains a number of tools, editor and wizards that will help you in your tasks.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
*[[IDE Key Bindings]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Среда_разработки]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:IDE]]&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=CGI_Applications&amp;diff=1219</id>
		<title>CGI Applications</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=CGI_Applications&amp;diff=1219"/>
		<updated>2008-09-30T16:04:18Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{CGI Applications Navbar}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;CGI&amp;#039;&amp;#039;&amp;#039; stands for [[wikipedia:Common Gateway Interface|&amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;ommon &amp;#039;&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;ateway &amp;#039;&amp;#039;&amp;#039;I&amp;#039;&amp;#039;&amp;#039;nterface]]. It is a specification recommended by the World Wide Web Consortium for one kind of information streaming in and out of web servers.&lt;br /&gt;
&lt;br /&gt;
As you maybe know, HTML browsers (such as Internet Explorer, Netscape etc.) send and receive information from web servers. But the experience of the world wide web is not a simple act of just reading some hyper-linked HTML files. There is interaction. Data moves both in and out of a browser, including data filled into forms in the browser by the user. There are many things the web server cannot handle on its own. How does it then handle such interactive data?&lt;br /&gt;
&lt;br /&gt;
A web server is a primitive creature actually. It usually serves out HTML files; and other files of mime-types that it recognizes, back to the browsers. It usually cannot do advanced stuff, like accessing a database in the background and sending database queries back to the browsers. CGI was invented to increase the functionality of web servers. It allows web servers to talk to CGI applications residing on the same machine as the web server itself. CGI applications do the job that the web server by itself is unable to do. For example; accessing databases in the background or conducting sophisticated searches. Web servers that use CGI, are usually able to send more information to the browsers than those that do not use CGI.&lt;br /&gt;
&lt;br /&gt;
===What is the significance of a &amp;#039;common gateway?&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
The word &amp;#039;common&amp;#039; signifies that the convention is accepted by all web servers. The word &amp;#039;gateway&amp;#039; represents the fact that data is obtained, as if by stepping through a &amp;#039;door&amp;#039; or a gateway into other processes that lay on the other side. Metaphorically, a web server stands on one side of the gateway and a CGI application stand on the other side and both of them &amp;#039;&amp;#039;talk&amp;#039;&amp;#039; to each other using CGI.&lt;br /&gt;
&lt;br /&gt;
===What is streaming?===&lt;br /&gt;
&lt;br /&gt;
By the term streaming, we mean that the information is processed one character at a time in a long queue. Think of a pipe whose diameter allows only one character to pass through at any instance. The characters passing through the pipe will emerge at the other pipe end, only one character at a time, in the form of a stream.&lt;br /&gt;
&lt;br /&gt;
Just like in a pipe, where water cannot go streaming in both directions; a stream in the programming world cannot be both readable and writable simultaneously. Either characters come out from the stream (which means the stream is a readable stream), or characters are placed into the stream (a writable stream) but the same stream cannot be used for both purposes by a single program.&lt;br /&gt;
&lt;br /&gt;
In the case of CGI applications, the characters are in &amp;#039;&amp;#039;&amp;#039;ANSI&amp;#039;&amp;#039;&amp;#039; format, and so they are 8-bit characters. This point has to be noted later on, as Visual Prolog by default uses &amp;#039;&amp;#039;&amp;#039;[[Unicode]]&amp;#039;&amp;#039;&amp;#039; characters, which are 16-bit. There are predicates available in Visual Prolog that collect streamed ANSI characters together, so processing streams would not be a problem. Eventually, it must be pointed out, our experience of the world wide web happens because of the streaming characters arriving through the Internet pipeline into our browsers one character at a time. We just don&amp;#039;t notice it though, because once the individual characters reach the browser, they are quickly assembled together.&lt;br /&gt;
&lt;br /&gt;
===What is a mime-type?===&lt;br /&gt;
&lt;br /&gt;
Think of mime-type as a file extension. It tells the web server the kind of files it and its clients (i.e., browsers) can handle. Most web servers determine the mime-type by the file extensions it sees. When a browser interacts with a web server, it initially informs the web server about the mime-type handling capabilities the browser has, along with the resource (file of a particular mime-type, etc.) it wants the web server to give. The web server sends over the requisite file to the browser for the browser to display. Examples are: .html, .jpg, .gif, etc. Non-recognized mime-types are either not sent to the browser by the web server, or are sent as plain ASCII or as HTML (the actual behavior depends on the web server).&lt;br /&gt;
&lt;br /&gt;
As the information is sent as a stream to the browser, the web server embeds some headers at the start of the stream, containing the mime-type. See Illustration 1 for a typical example of what gets sent across from a web server to a browser. Once these files with mime-types reach the browser, it analyzes the headers, deduces the mime-type the data represents, and as per its own internal table of mime-types it can handle, it displays the data accordingly.&lt;br /&gt;
&lt;br /&gt;
[[Image:cgiApplicationsInVisualProlog06.jpg|frame|Illustration 1]]&lt;br /&gt;
&lt;br /&gt;
===What is a header?===&lt;br /&gt;
&lt;br /&gt;
A header, in the context of this tutorial, is a line of text followed by a carriage return embedded in the stream before the actual data begins. In Illustration 1, the lines you see above the data, are the headers that were passed by the web server to the browser. There is a blank line separating the headers from the actual data.&lt;br /&gt;
&lt;br /&gt;
Notice the &amp;#039;Content-type:...&amp;#039; header in the illustration. That line indicates the mime-type of the data. This particular line is specifically relevant to CGI applications, as when a web server calls on the services of a CGI application to provide data to be passed on to a browser, it is clueless on the mime-type of the data that the CGI application would be giving. Hence, by convention, the CGI application is responsible for pass this particular header before the rest of the data (separated by a blank line). Note this point carefully when we actually get around to programming CGI applications, because forgetting either the Content-type header or the blank line (between the set of headers and the actual data), or both is a common occurrence and it can lead to a lot of agony.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What is a CGI application?===&lt;br /&gt;
&lt;br /&gt;
A CGI application or a gateway program (see Illustration 2) is an executable file (usually an .exe file), which does not receive any information via the keyboard or the mouse, i.e., it is not an interactive application (a GUI application would be an interactive application). Such applications are known as console applications. They receive their inputs using the &amp;#039;&amp;#039;stdin&amp;#039;&amp;#039; stream and they put out their outputs into the &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039; stream.&amp;lt;br /&amp;gt;&lt;br /&gt;
The rest of the headers are added by the web server after a CGI application does its work, and the compiled information is then passed to the browser.&lt;br /&gt;
&lt;br /&gt;
[[Image:cgiApplicationsInVisualProlog07.jpg|frame|Illustration 2]]&lt;br /&gt;
&lt;br /&gt;
In case of CGI applications, once you start them, they terminate on its own without any inputs from you. You can say that they work &amp;#039;&amp;#039;automatically&amp;#039;&amp;#039; like the old DOS command line programs such as xcopy, or format, etc.&lt;br /&gt;
&lt;br /&gt;
A CGI application, however, is not just any console application. It would expect the inputs as per the CGI specification and its outputs should also conform to the CGI specification.&lt;br /&gt;
&lt;br /&gt;
In certain situations, a CGI application can be written as a .DLL file; but such variations are web server dependent. There are even more exotic variations possible. For example, even batch files (.bat files) can be made into simple CGI applications, provided the web server is configured to accept such files as CGI applications. Let us not get into those variations. For the purpose of this tutorial we&amp;#039;ll assume that a CGI application is an executable, console application (.exe file), adhering to the CGI specifications.&lt;br /&gt;
&lt;br /&gt;
===What are &amp;#039;&amp;#039;stdin&amp;#039;&amp;#039; and &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039; streams?===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;stdin&amp;#039;&amp;#039; is the name given in various programming languages, to a special stream that acts as the input stream from the underlying OS (Operating System). Programs (such as those written in Visual Prolog) can read the &amp;#039;&amp;#039;stdin&amp;#039;&amp;#039; stream, and use the characters given by that stream as their input. Similarly, &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039; is a stream managed by the OS into which programs will output their characters into.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039; and &amp;#039;&amp;#039;stdin&amp;#039;&amp;#039; streams can be daisy chained (i.e joined end to end) from different programs. For example, a program &amp;#039;A&amp;#039; can write into its &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039; stream, and then call a program &amp;#039;B&amp;#039;, which in turn will use the &amp;#039;&amp;#039;stdin&amp;#039;&amp;#039; stream to pick up what was written by the program &amp;#039;A&amp;#039;. This is essentially the transfer mechanism used by web servers: in the previous example, the program &amp;#039;A&amp;#039; represents the web server and the program &amp;#039;B&amp;#039; is the CGI application. The &amp;#039;&amp;#039;stdin&amp;#039;&amp;#039; and &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039; streams are often referred together as the console.&lt;br /&gt;
&lt;br /&gt;
===How does the flow of information take place, using CGI?===&lt;br /&gt;
&lt;br /&gt;
The information flow starts from a request placed by the client (i.e., the browser) with the web server. As noted before, the client tells the web server about the various capabilities it has, and also speciies the information that it requires from the web server. See Illustration 3, which shows what gets sent by a browser (the client) to the web server.&lt;br /&gt;
&lt;br /&gt;
[[Image:cgiApplicationsInVisualProlog08.jpg|frame|Illustration 3]]&lt;br /&gt;
&lt;br /&gt;
The first line contains the method field. This indicates the desired HTTP method, the resource being requested, the protocol version, etc., i.e., GET /Tests/file.html HTTP/1.0&amp;#039;&amp;#039;.&amp;#039;&amp;#039; Though /Test/file.html looks like a path, it is actually known as a URL (Uniform Resource Locator) and it represents a whole lot of things; including actual filenames and directories on the machine where the web server is located.&lt;br /&gt;
&lt;br /&gt;
Other common methods are &amp;#039;&amp;#039;&amp;#039;POST&amp;#039;&amp;#039;&amp;#039; (for sending data from the client to the server (not as part of the URL)) and &amp;#039;&amp;#039;&amp;#039;HEAD&amp;#039;&amp;#039;&amp;#039; (retrieve only header information about the resource).Other fields contain information about the client. The &amp;#039;&amp;#039;&amp;#039;Accept:&amp;#039;&amp;#039;&amp;#039; fields tell the server the different types of data that the client can accept. These are sent as MIME Content-type messages. Thus Accept: text/plain means that the client can accept plain text files, and so on. This MIME type is important, as this is how web servers tell clients the type of data being sent. The other headers are informational: &amp;#039;&amp;#039;&amp;#039;User-Agent:&amp;#039;&amp;#039;&amp;#039; - a program making the request, &amp;#039;&amp;#039;&amp;#039;From:&amp;#039;&amp;#039;&amp;#039; - who is making the request, &amp;#039;&amp;#039;&amp;#039;Referer:&amp;#039;&amp;#039;&amp;#039; - gives the URL of the document making this request, and so on. The server responds by returning the desired data. It first sends server response headers, which communicate information about the state of the transaction, the type of data being sent, and any additional information. This is followed by a blank line and then the actual data being sent to the client. We saw this, in Illustration 1. Where does the CGI come into this?, - you may wonder. Well, let us re-visit the requested resource, which is in the above example /Tests/file.htm&amp;#039;&amp;#039;l,&amp;#039;&amp;#039; if instead of that, it was /cgi-bin/helloworld.exe. Many web servers are configured to let the partial URL /cgi-bin/ indicate that helloword.exe is a CGI program, which the WEB server must invoke.&lt;br /&gt;
&lt;br /&gt;
Hence helloword.exe would be called by the web server and it would pass on some information to helloworld.exe using some environment variables and the &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039; stream (which is the &amp;#039;&amp;#039;stdin&amp;#039;&amp;#039; stream for helloworld.exe). The web server will then wait till the CGI application, helloworld.exe, finishes its work.&lt;br /&gt;
&lt;br /&gt;
Once helloworld.exe ceases execution, the web server would gather the data written by helloworld.exe (including the Content-type header), and send it to the waiting browser.&lt;br /&gt;
&lt;br /&gt;
Phew! All that should ideally happen in the smallest period possible.&lt;br /&gt;
&lt;br /&gt;
Thankfully, all web servers are designed to do its job well and so we do not have to worry about the assembly work performed by a web server after it invokes a CGI application. Let us concentrate instead on how a CGI application should read information from the web server and then pass its data back to the web server, after doing its work.&lt;br /&gt;
&lt;br /&gt;
===What is an environment variable?===&lt;br /&gt;
&lt;br /&gt;
All OS (Operating Systems) allow programmers to insert name=value relationships in what are known as environment variables, somewhere in the computer&amp;#039;s RAM (Random Access Memory). For example; the PATH setting in DOS is an environment variable. You can examine the various environment variables that are set for DOS (or Windows XP or Windows 2000 for that matter) using the SET command. Just give SET command on a command line prompt, and the console will display all the currently available environment variables. (In the displayed list, you would see PATH also).&lt;br /&gt;
&lt;br /&gt;
The best part of the concept of environment variables is that you can cook up your very own variables and assign values to them. For example; if you want to keep a password around somewhere, you could do this using the SET command at the OS command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SET password=xyze&amp;lt;/pre&amp;gt;Though the value is a string, you don&amp;#039;t have to give quotes. All values are internally stored as strings, and they are retrieved by Visual Prolog programs as strings. The significance of environment variables in CGI applications is that a web server uses various environment variables also to pass information to the CGI application that it invokes. Here is an example.&lt;br /&gt;
&lt;br /&gt;
We learnt that a web server places a lot of data on the &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039; stream before calling a CGI application. How does the CGI application know the number of characters to read from the flowing stream? To facilitate this, the web server places the content length into an environment variable called, CONTENT_LENGTH, and using that environment variable&amp;#039;s value the CGI application can read the right amount of characters from the stream. Let us examine some Visual Prolog code from cgi.pro (as part of the CGI pack that came with Visual Prolog) that does this:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    retrieve_POST_string() = Result :- % Get the length&lt;br /&gt;
        LenStr = environment::getVariable(&amp;#039;CONTENT_LENGTH&amp;#039;),&lt;br /&gt;
        Len = toTerm(LenStr),&lt;br /&gt;
        %Read the stream to the desired length only&lt;br /&gt;
        Stream = console::getConsoleInputStream(),&lt;br /&gt;
        Stream:setMode(stream::ansi(ansi())),&lt;br /&gt;
        %The stream is in ANSI mode!&lt;br /&gt;
        Result = Stream:readString(Len).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apart from CONTENT_LENGTH, most web servers set the following &amp;#039;&amp;#039;standard&amp;#039;&amp;#039; environment variables before starting a CGI application. A few additions and subtractions may be possible to these environment variables, depending on the web server that you use. The CGI application, in turn can then look for those variables and use the values that are contained therein. The reader is requested to read about these environment variables elsewhere, else this tutorial would become too lengthy. Of these, the environment variable HTTP_REFERER can be useful in implementing some simple security measures (described later in Section B of the tutorial).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PATH_INFO&lt;br /&gt;
PATH_TRANSLATED&lt;br /&gt;
REMOTE_HOST&lt;br /&gt;
REMOTE_ADDR&lt;br /&gt;
GATEWAY_INTERFACE&lt;br /&gt;
SCRIPT_NAME&lt;br /&gt;
REQUEST_METHOD&lt;br /&gt;
HTTP_ACCEPT&lt;br /&gt;
HTTP_ACCEPT_CHARSET&lt;br /&gt;
HTTP_ACCEPT_ENCODING&lt;br /&gt;
HTTP_ACCEPT_LANGUAGE&lt;br /&gt;
HTTP_FROM HTTP_HOST&lt;br /&gt;
HTTP_REFERER&lt;br /&gt;
HTTP_USER_AGENT&lt;br /&gt;
HTTP_COOKIE&lt;br /&gt;
QUERY_STRING&lt;br /&gt;
SERVER_SOFTWARE&lt;br /&gt;
SERVER_NAME&lt;br /&gt;
SERVER_PROTOCOL&lt;br /&gt;
SERVER_PORT&lt;br /&gt;
CONTENT_TYPE&lt;br /&gt;
CONTENT_LENGTH&lt;br /&gt;
USER_NAME&lt;br /&gt;
USER_PASSWORD&lt;br /&gt;
AUTH_TYPE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How do I test CGI applications?===&lt;br /&gt;
&lt;br /&gt;
You would need to have a web server installed, along with your CGI application in order to test it. You would also need support HTML files, which will trigger the CGI application through the web server. They will obviously vary from one application to another. You&amp;#039;ll become aware of such support files, when you study the examples.&lt;br /&gt;
&lt;br /&gt;
As indicated somewhere before, a CGI application has to be placed in the same machine, where the web server is itself running. For reasons of security, a web server is able to fetch files from only a specific set of directories (the set is known as the web-path) on the host machine. Therefore, you should place a CGI application files (CGI executable file and HTML files) into one of these directories.If that was not the case, some malicious user may try to fetch files that should not have been retrievable.&lt;br /&gt;
&lt;br /&gt;
Similarly, a web server can only invoke a CGI application if it is placed in the right directory. You cannot place the CGI application anywhere on the web-path (well, a few web server do allow that too, but not all). Now, all web servers have a configuration method (a separate configuration file, or an .ini file or the windows registry, etc.) to configure its various settings. One of the crucial settings is the location of the CGI applications. When you zero in on a web server for your CGI application, the first thing you should study is how that particular web server configures its CGI application directories.&lt;br /&gt;
&lt;br /&gt;
===Which web server to use?===&lt;br /&gt;
&lt;br /&gt;
As indicated before, web servers are not complicated pieces of software. There are many web servers available free of cost. A large list can be seen at: http://www.serverwatch.com/stypes/index.php/d2Vi . That list includes both commercial software as well as free ones. The complexity of the web server is usually the configuration of the web-path and CGI application directory/directories of the web server.&lt;br /&gt;
&lt;br /&gt;
The TCP-IP protocol should be installed in the computer where the web server is to be setup (It usually would be, if you are able to browse the Internet from that computer) Once you have successfully installed a web server, you should be able to get data from the web server by supplying either the IP address or the domain name of the machine where the web server is installed. Please note that the CGI programs should work fine with the most of web servers including the IIS5 web server which is usually included with Windows 2000 by Microsoft.&lt;br /&gt;
&lt;br /&gt;
===Where to place the CGI application?===&lt;br /&gt;
&lt;br /&gt;
Ensure that the CGI application is placed correctly in such a web server&amp;#039;s appropriate script directory. This will vary from a web server to a web server. In this tutorial, we will assume that you have placed it in such a directory that it can be invoked using a browser on the server machine with the following URL: &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;http://localhost/cgi-bin/&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;APPNAME&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
For example, if you have a CGI application called example1.exe, then it should be accessible with the following URL, on the server machine: &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;http://localhost/cgi-bin/example1.exe&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
===Can you show me a very simple CGI application created using Visual Prolog?===&lt;br /&gt;
&lt;br /&gt;
Yes, indeed! You should unzip the file example1.zip that is included into cgitutorial.zip into a convenient place and examine the Visual Prolog files therein. But, you can create such an application from scratch too by following the instructions given below.&lt;br /&gt;
&lt;br /&gt;
Start a new Visual Prolog project. Note that the UI Strategy is Console:&lt;br /&gt;
&lt;br /&gt;
[[Image:cgiApplicationsInVisualProlog01.png]]&lt;br /&gt;
&lt;br /&gt;
The main Project tree would get displayed. It will include all the necessary files that the IDE has intelligently decided you may require.&lt;br /&gt;
&lt;br /&gt;
[[Image:cgiApplicationsInVisualProlog02.png]]&lt;br /&gt;
&lt;br /&gt;
Now, click on the main &amp;#039;&amp;#039;Build&amp;#039;&amp;#039; menu, and in that menu, select &amp;#039;&amp;#039;Build&amp;#039;&amp;#039; or press &amp;#039;&amp;#039;&amp;#039;Ctrl-Shift-B&amp;#039;&amp;#039;&amp;#039;. You&amp;#039;ll notice something magical, as the build process continues. As the project is being built, the IDE will pull in all the relevant PFC (Prolog Foundation Classes) files that were not visible earlier in the Project Tree. After the build process is over, the Project Tree will now look like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:cgiApplicationsInVisualProlog03.png]]&lt;br /&gt;
&lt;br /&gt;
Congratulations! You have finished 95% of the job. Now you would be having a console application in the EXE folder of your project, which currently does nothing. We need now to add the relevant code to transform the application into a CGI application&lt;br /&gt;
&lt;br /&gt;
As explained in the earlier sections of this tutorial, a CGI application expects some input from the &amp;#039;&amp;#039;stdin&amp;#039;&amp;#039; stream (Along with some environment variables), then it does its work and sends out the output through the &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039; stream. As this is a very simple CGI application (our very first one) we&amp;#039;ll ignore all input arriving into our CGI application from the &amp;#039;&amp;#039;stdin&amp;#039;&amp;#039; stream, (which the web server may be sending to the CGI application). Instead, we&amp;#039;ll make our little application send some output.&lt;br /&gt;
&lt;br /&gt;
Double click on the file &amp;#039;&amp;#039;&amp;#039;main.pro&amp;#039;&amp;#039;&amp;#039; in the Project Tree, and go towards the end of the code:&lt;br /&gt;
&lt;br /&gt;
[[Image:cgiApplicationsInVisualProlog04.png]]&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;ll notice that the main goal of the program invokes a predicate called run from the PFC module mainEXE. That module in turns invokes the predicate called &amp;#039;&amp;#039;&amp;#039;run()&amp;#039;&amp;#039;&amp;#039; from &amp;#039;&amp;#039;&amp;#039;main.pro&amp;#039;&amp;#039;&amp;#039;, so let us have a look at that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    run():-&lt;br /&gt;
console::init(),&lt;br /&gt;
succeed().  % place your own code here&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ll modify that code to make it look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        console::init(), %Line 1&lt;br /&gt;
        cgi::init(stream::ansi(core::ansi)), %Line 2&lt;br /&gt;
        stdIO::write(&amp;quot;Content-type:   text/html\n&amp;quot;), %Line 3&lt;br /&gt;
        stdIO::write(&amp;quot;\n&amp;quot;), %Line 4&lt;br /&gt;
        stdIO::write(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;Hello World!&amp;lt;/h1&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;). %Line 5&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us now go through the code, line by line:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Line 1:&amp;#039;&amp;#039;&amp;#039; is a Visual Prolog requirement. All work using the &amp;#039;&amp;#039;console&amp;#039;&amp;#039;, should first start with console::init() .&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Line 2:&amp;#039;&amp;#039;&amp;#039; captures the &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039; stream object to CGI output. As explained in the paragraph of this tutorial, the CGI application is expected to send its output to the &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Line 3:&amp;#039;&amp;#039;&amp;#039; Now the CGI application is prepared to send the first line back to the calling web server. As explained in the paragraph of this tutorial, the data has to be preceded by some headers. The header which is mandatory is the one that sets the mime-type of the data. Here, it states that the Content-type of the data is of the mime-type text/html. Notice that the line ends in a carriage return (\n).&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Line 4:&amp;#039;&amp;#039;&amp;#039; To separate the headers from the rest of the data a blank line is needed. It is mandatory as per the CGI specification. So the CGI application now sends a blank line (\n) there. Forgetting to do this is very common in CGI applications (Read the paragraph of this tutorial for more), and it can lead to the malfunctioning of the application.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Line 5:&amp;#039;&amp;#039;&amp;#039; In the end the actual data is written out to the &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039;. In this example, it is simply creating an HTML file and sending that. The HTML file contains just two words : &amp;#039;&amp;#039;&amp;#039;Hello World!&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
===How to test Example1.exe?===&lt;br /&gt;
&lt;br /&gt;
Place it in the script directory of your web server, as explained earlier. Then access the following URL on the same machine as the web server &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;http://localhost/cgi-bin/example1.exe&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; using a suitable browser.&lt;br /&gt;
&lt;br /&gt;
===What is the functionality of such a primitive application?===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;Hello World&amp;#039;&amp;#039; CGI application (Example1) is not actually as primitive as it seems. It is simple alright, but it can serve as the seed for much sophisticated stuff. Take the last line (Line 6 explained in Paragraph of this tutorial). There the complete HTML is created and then dispatched over the &amp;#039;&amp;#039;stdout&amp;#039;&amp;#039; stream to the web server, who in turn, sends it to the requesting browser. If you introduce a database access at that point, and add some more predicates for conditional processing of the data from the background databases, you can easily build a content management system&lt;br /&gt;
&lt;br /&gt;
===What about inputs?===&lt;br /&gt;
&lt;br /&gt;
As indicated earlier, we have ignored whatever inputs the web server may have given to our little application. If the CGI application needed some inputs, then the &amp;#039;&amp;#039;stdin&amp;#039;&amp;#039; stream would have to be read, and processed for information. Also, the environment variables set at the time of the CGI application operation would also have to be examined. This can be a little complex. Luckily for us, we do not have to do much programming in Visual Prolog when developing CGI applications. For example, to know what data the CGI application receives from the web server, all we have to do is to use the cgi::getString() predicate. (We have to include the cgi.pack from the PFC into our project). And if we need the data in a more convenient form, then we can use the cgi::getParamList() predicate. The individual pieces of data are assembled by cgi::getParamList() into name, value pairs similar to environment variables.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Internet]]&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:CgiApplicationsInVisualProlog04.png&amp;diff=1218</id>
		<title>File:CgiApplicationsInVisualProlog04.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:CgiApplicationsInVisualProlog04.png&amp;diff=1218"/>
		<updated>2008-09-30T15:53:47Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:CgiApplicationsInVisualProlog03.png&amp;diff=1217</id>
		<title>File:CgiApplicationsInVisualProlog03.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:CgiApplicationsInVisualProlog03.png&amp;diff=1217"/>
		<updated>2008-09-30T15:53:28Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:CgiApplicationsInVisualProlog02.png&amp;diff=1216</id>
		<title>File:CgiApplicationsInVisualProlog02.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:CgiApplicationsInVisualProlog02.png&amp;diff=1216"/>
		<updated>2008-09-30T15:52:58Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:CgiApplicationsInVisualProlog01.png&amp;diff=1215</id>
		<title>File:CgiApplicationsInVisualProlog01.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:CgiApplicationsInVisualProlog01.png&amp;diff=1215"/>
		<updated>2008-09-30T15:52:15Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: uploaded a new version of &amp;quot;Image:CgiApplicationsInVisualProlog01.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CGI Applications in VisualProlog 01&lt;br /&gt;
&lt;br /&gt;
{{Tutorial Image}}&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:Fundamental_Prolog_1_PIE.png&amp;diff=1214</id>
		<title>File:Fundamental Prolog 1 PIE.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:Fundamental_Prolog_1_PIE.png&amp;diff=1214"/>
		<updated>2008-09-30T15:38:32Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: uploaded a new version of &amp;quot;Image:Fundamental Prolog 1 PIE.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prolog Inference Engine (PIE)&lt;br /&gt;
&lt;br /&gt;
{{Tutorial Image}}&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=How_to_use_GUI_Package_in_Visual_Prolog&amp;diff=1213</id>
		<title>How to use GUI Package in Visual Prolog</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=How_to_use_GUI_Package_in_Visual_Prolog&amp;diff=1213"/>
		<updated>2008-09-30T14:05:07Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A sample Graphical User Interface (&amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039;) application can be created by Integrated Development Environment (&amp;#039;&amp;#039;&amp;#039;IDE&amp;#039;&amp;#039;&amp;#039;) as a default project. In this tutorial, we will explain how to develop such application further. We will learn how to create and edit &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; components of &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; style programs directly within the Visual Prolog IDE (Visual Development Environment). We will learn principles of handling &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; package events (like clicking buttons, activating menu items, etc.), and how these are implemented within&amp;#039;&amp;#039;&amp;#039; GUI&amp;#039;&amp;#039;&amp;#039; style Visual Prolog programs. We will learn how to program dialogs, etc.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; package presents object-oriented windows, dialogs, and controls handling. This package is built on top of the &amp;#039;&amp;#039;&amp;#039;VPI&amp;#039;&amp;#039;&amp;#039; package and delivers a new level of abstraction and ease of use. When using the &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; package, you can also use the &amp;#039;&amp;#039;&amp;#039;VPI&amp;#039;&amp;#039;&amp;#039; package.&lt;br /&gt;
&lt;br /&gt;
==Introduction to the &amp;#039;&amp;#039;&amp;#039;GUI Package&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
If you have read our previous GUI programming tutorials &amp;quot;&amp;#039;&amp;#039;&amp;#039;Fundamental Visual Prolog - Conventional GUI&amp;#039;&amp;#039;&amp;#039;&amp;quot; and &amp;quot;&amp;#039;&amp;#039;&amp;#039;Fundamental Visual Prolog - the Business Logical Layer&amp;#039;&amp;#039;&amp;#039;&amp;quot;, then you already knew that Visual Prolog PFC packages contain the &amp;#039;&amp;#039;&amp;#039;VPI&amp;#039;&amp;#039;&amp;#039; package, which can be used to program Graphical User Interface applications. But &amp;#039;&amp;#039;&amp;#039;VPI&amp;#039;&amp;#039;&amp;#039; package classes do not produce GUI objects. Therefore &amp;#039;&amp;#039;&amp;#039;VPI&amp;#039;&amp;#039;&amp;#039; does not supply the power of state handling via interface predicates.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; package provides an object oriented style for working with windows, dialogs, controls, events, and other GUI features. The GUI package provides the following window system components, which supports programming of your application presentation layer (GUI of your application):&lt;br /&gt;
&lt;br /&gt;
*Basic window components: windows, dialogs, controls (check buttons, edit controls, icon controls, list boxes, list buttons, list edit controls, push buttons, radio buttons, horizontal and vertical scroll controls, static text controls, custom controls, and some more complex controls like the editor, tree view and list view controls, etc. ).&lt;br /&gt;
&lt;br /&gt;
*Containers - objects to which you can add controls (these are dialogs, container controls, form windows, etc.).&lt;br /&gt;
&lt;br /&gt;
*Layout management system that supports sizing, positioning, and moving of GUI objects.&lt;br /&gt;
&lt;br /&gt;
*The GUI package event handling system. It notices when the user interacts with one of GUI components and pass this information to the application.&lt;br /&gt;
&lt;br /&gt;
*Graphic operations: draw arcs, fill polygons, clip a rectangle, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Creating a New &amp;#039;&amp;#039;&amp;#039;GUI Style Project&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
Now let us start creating a GUI style project from the very beginning.&lt;br /&gt;
&lt;br /&gt;
First of all, you need to run the &amp;#039;&amp;#039;&amp;#039; IDE&amp;#039;&amp;#039;&amp;#039;. At this point we expect that you had already read the &amp;#039;&amp;#039;&amp;#039;Environment Overview&amp;#039;&amp;#039;&amp;#039; tutorial and know how to do this.&lt;br /&gt;
&lt;br /&gt;
Then you should initiate creation of a new project selecting the &amp;#039;&amp;#039;&amp;#039;Project | New&amp;#039;&amp;#039;&amp;#039; menu command. The Project Settings dialog appears. In the &amp;#039;&amp;#039;&amp;#039;Project Name&amp;#039;&amp;#039;&amp;#039; edit control you should type-in the project name, in this example we use &amp;#039;&amp;#039;&amp;#039;guiDemo&amp;#039;&amp;#039;&amp;#039;. Keep the settings (&amp;#039;&amp;#039;&amp;#039;UI Strategy&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Target Type&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Linker Name&amp;#039;&amp;#039;&amp;#039;) in their default state. You can also select the &amp;#039;&amp;#039;&amp;#039;Base Directory&amp;#039;&amp;#039;&amp;#039;, which will serve as the default root directory to all your new projects. The default &amp;#039;&amp;#039;&amp;#039;Sub-Directory&amp;#039;&amp;#039;&amp;#039; name will be generated automatically, as you will type-in the &amp;#039;&amp;#039;&amp;#039;Project Name&amp;#039;&amp;#039;&amp;#039; (of course, you can manually modify this name). So we have:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Project Name&amp;#039;&amp;#039;&amp;#039; = &amp;#039;&amp;#039;&amp;#039;guiDemo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;UI Strategy&amp;#039;&amp;#039;&amp;#039; = &amp;#039;&amp;#039;&amp;#039;Object-oriented GUI&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Target Type&amp;#039;&amp;#039;&amp;#039; = &amp;#039;&amp;#039;&amp;#039;EXE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Click &amp;#039;&amp;#039;&amp;#039;Create&amp;#039;&amp;#039;&amp;#039; to create the default project. After this the &amp;#039;&amp;#039;&amp;#039; IDE&amp;#039;&amp;#039;&amp;#039; will generate the initial set of project files required to a &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; style project.&lt;br /&gt;
&lt;br /&gt;
==Execute the Created Default Project &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
As you can expect the default project creates a trivial but working application, to check this let us run the generated default application. You can run it directly from the &amp;#039;&amp;#039;&amp;#039; IDE&amp;#039;&amp;#039;&amp;#039; using the &amp;#039;&amp;#039;&amp;#039;Build | Execute&amp;#039;&amp;#039;&amp;#039; command or simply press the &amp;#039;&amp;#039;&amp;#039;Ctrl+F5&amp;#039;&amp;#039;&amp;#039; key combination.&lt;br /&gt;
&lt;br /&gt;
==How to Study the Generated Code==&lt;br /&gt;
&lt;br /&gt;
All components of your application are registered in the &amp;#039;&amp;#039;&amp;#039;Project&amp;#039;&amp;#039;&amp;#039; window. Here you can see the initial set of project files generated by the IDE to a default &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; style project in the IDE &amp;#039;&amp;#039;&amp;#039;Project&amp;#039;&amp;#039;&amp;#039; window (remember that previously you need to build the project using, for example, the &amp;#039;&amp;#039;&amp;#039;Build | Build&amp;#039;&amp;#039;&amp;#039; command or simply press the &amp;#039;&amp;#039;&amp;#039;Ctrl+Shift+B&amp;#039;&amp;#039;&amp;#039; key combination). You will see in the &amp;#039;&amp;#039;&amp;#039;Project&amp;#039;&amp;#039;&amp;#039; window the following tree of the project files:&lt;br /&gt;
&lt;br /&gt;
[[Image:GUI_Package_Project_tree0.png]]&lt;br /&gt;
&lt;br /&gt;
You see that the root directory of your project contains the following files:&lt;br /&gt;
&lt;br /&gt;
*main.pack this is the main package of our application.&lt;br /&gt;
&lt;br /&gt;
*main.ph this is the header file of the application main package.&lt;br /&gt;
&lt;br /&gt;
*main.cl this class declares the application main predicate run.&lt;br /&gt;
&lt;br /&gt;
*main.pro this file implements the application main predicate run and declares the standard application goal.&lt;br /&gt;
&lt;br /&gt;
*resourceidentifiers.i this file is automatically updated by the IDE after any changes of project resource identifiers. It contains definitions of symbolic constants specified for GUI components in the IDE resource editors.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*guiDemo.manifest this is the manifest file of the application. It contains some settings of the application in XML format.&lt;br /&gt;
&lt;br /&gt;
Notice that you should not make any editing in it since any your changes will be overwritten while automatic update.&lt;br /&gt;
&lt;br /&gt;
The $(ProDir)\PFC subdirectory contains that Prolog Foundation Classes (&amp;#039;&amp;#039;&amp;#039;PFC&amp;#039;&amp;#039;&amp;#039;) packages, which are used by the default &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; style applications. Each package is in a separate subdirectory. For example, the gui subdirectory contains &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; package source files and you can see implementation details of &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; package itself here. Source files of these packages will be compiled and the obtained OBJect files will be linked into the target application.&lt;br /&gt;
&lt;br /&gt;
In the first step we will modify Task Window, therefore let us see which files are generated in the &amp;#039;&amp;#039;&amp;#039;taskWindow&amp;#039;&amp;#039;&amp;#039; package. Simply click on the &amp;#039;+&amp;#039; box before the taskWindow subdirectory and then click on the &amp;#039;+&amp;#039; box before the appeared Toolbar subdirectory. You will see the following files:&lt;br /&gt;
&lt;br /&gt;
[[Image:GUI_Package_Project_tree2.png]]&lt;br /&gt;
&lt;br /&gt;
At this picture you see that the IDE generates files containing the following GUI components:&lt;br /&gt;
&lt;br /&gt;
*the main Task window of the application (stored in the .\TaskWindow\TaskWindow.win file);&lt;br /&gt;
&lt;br /&gt;
*the main application menu (stored in the .\TaskWindow\TaskWindow.mnu file);&lt;br /&gt;
&lt;br /&gt;
*one top toolbar (stored in the .\TaskWindow\Toolbars\ProjectToolbar.tb file);&lt;br /&gt;
&lt;br /&gt;
*one bottom status bar or status line (stored in the .\TaskWindow\Toolbars\StatusLine.tb file);&lt;br /&gt;
&lt;br /&gt;
*the &amp;#039;&amp;#039;&amp;#039;About&amp;#039;&amp;#039;&amp;#039; dialog (in the .\TaskWindow\AboutDialog.dlg file).&lt;br /&gt;
&lt;br /&gt;
These are text format files store resources describing GUI components generated for the project. Text descriptions stored in these files hold full information about correspondent GUI components, including resource attributes, resource layout, and settings for &amp;#039;&amp;#039;&amp;#039;Code Experts&amp;#039;&amp;#039;&amp;#039;. The resource files for GUI components are stored in files with .win, .frm, .ctl, .mnu, .dlg, .tb, .bmp, .ico, and .cur filename extensions.&lt;br /&gt;
&lt;br /&gt;
Let us investigate contents of the TaskWindow.i file. You see that except for other code it contains the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;interface taskWindow supports applicationWindow&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that the &amp;#039;&amp;#039;&amp;#039;taskWindow&amp;#039;&amp;#039;&amp;#039; interface supports the &amp;#039;&amp;#039;&amp;#039;applicationWindow&amp;#039;&amp;#039;&amp;#039; interface declared in the &amp;#039;&amp;#039;&amp;#039;GUI&amp;#039;&amp;#039;&amp;#039; package. Select &amp;#039;&amp;#039;&amp;#039;applicationWindow&amp;#039;&amp;#039;&amp;#039; and press the &amp;#039;&amp;#039;&amp;#039;F1&amp;#039;&amp;#039;&amp;#039; key, the IDE will activate the Visual Prolog help and open the topic describing the &amp;#039;&amp;#039;&amp;#039;applicationWindow&amp;#039;&amp;#039;&amp;#039; interface. In this help you can read that the &amp;#039;&amp;#039;&amp;#039;applicationWindow::new/0&amp;#039;&amp;#039;&amp;#039; predicate creates an &amp;#039;&amp;#039;&amp;#039;applicationWindow&amp;#039;&amp;#039;&amp;#039; type object correspondent to the Task windows of an application. Notice that the only one &amp;#039;&amp;#039;&amp;#039;applicationWindow&amp;#039;&amp;#039;&amp;#039; type object can be created during an application execution.&lt;br /&gt;
&lt;br /&gt;
Now open the TaskWindow.pro file. You see the following clauses for the new/0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;clauses&lt;br /&gt;
    new():-&lt;br /&gt;
        applicationWindow::new(),&lt;br /&gt;
        generatedInitialize().&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
predicates&lt;br /&gt;
    generatedInitialize : ().&lt;br /&gt;
clauses&lt;br /&gt;
    generatedInitialize():-&lt;br /&gt;
        setText(&amp;quot;guiDemo&amp;quot;),&lt;br /&gt;
        setDecoration(titlebar([closebutton(),maximizebutton(),minimizebutton()])),&lt;br /&gt;
        setBorder(sizeBorder()),&lt;br /&gt;
        setState([wsf_ClipSiblings]),&lt;br /&gt;
        setMdiProperty(mdiProperty),&lt;br /&gt;
        menuSet(resMenu(resourceIdentifiers::id_TaskMenu)),&lt;br /&gt;
        addShowListener(generatedOnShow),&lt;br /&gt;
        addShowListener(onShow),&lt;br /&gt;
        addSizeListener(onSizeChanged),&lt;br /&gt;
        addDestroyListener(onDestroy),&lt;br /&gt;
        addMenuItemListener(resourceIdentifiers::id_help_about, onHelpAbout),&lt;br /&gt;
        addMenuItemListener(resourceIdentifiers::id_file_exit, onFileExit).&lt;br /&gt;
&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
 % end of automatic code&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You see that the clauses of the new/0 constructor are splitted onto two parts. The clause of the new/0 constructor itself and the  generatedInitialize/0 predicate, which is declared privately in the &amp;#039;&amp;#039;&amp;#039;taskWindow&amp;#039;&amp;#039;&amp;#039; class implementation. You can ask - &amp;quot;What for the extra the generatedInitialize/0 predicate is declared?&amp;quot; The answer to this question is in the lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;% This code is maintained. Do not update it manually    ... end of automatic code&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IDE need them to be able to automatically change parameters, which corresponds to the settings in &amp;#039;&amp;#039;&amp;#039;Code Experts&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==How to Modify the Default Task Window==&lt;br /&gt;
&lt;br /&gt;
Before we start to add any new user defined GUI components to this default project, let us look how we can modify its default task window parameters. In the project file tree click the right mouse button on the TaskWindow.win file. In the appeared popup menu select the &amp;#039;&amp;#039;&amp;#039;Attribute&amp;#039;&amp;#039;&amp;#039; item. The &amp;#039;&amp;#039;&amp;#039;Window Attributes&amp;#039;&amp;#039;&amp;#039; dialog appears:&lt;br /&gt;
&lt;br /&gt;
[[Image:GUI_Package_WindowAttributes.png]]&lt;br /&gt;
&lt;br /&gt;
In this dialog you see attributes of the task window. The &amp;#039;&amp;#039;&amp;#039;Title&amp;#039;&amp;#039;&amp;#039; field specifies the application title (name) &amp;#039;&amp;#039;&amp;#039;guiDemo&amp;#039;&amp;#039;&amp;#039;, which is displayed at run time in the application title bar. Let us modify it to &amp;#039;&amp;#039;&amp;#039;GUI Demo Title&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Style Flags&amp;#039;&amp;#039;&amp;#039; group of check boxes contains the style flags, which will control the look of the window. Let us set &amp;#039;&amp;#039;&amp;#039;Maximized&amp;#039;&amp;#039;&amp;#039; to ON. If you run the application now, then you will see that it is maximized initially and has got the title &amp;#039;&amp;#039;&amp;#039;GUI Demo Title&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==How to Add New GUI Dialog==&lt;br /&gt;
&lt;br /&gt;
Let us create a new GUI dialog in &amp;#039;&amp;#039;&amp;#039;TaskWindow&amp;#039;&amp;#039;&amp;#039; package. You can of course use any package for this purpose. To create the dialog it is necessary to put focus on the necessary package in &amp;#039;&amp;#039;&amp;#039;Project&amp;#039;&amp;#039;&amp;#039; window and choose menu command &amp;#039;&amp;#039;&amp;#039;File | New in Existing Package...&amp;#039;&amp;#039;&amp;#039; . You will see the dialog, where it is necessary to select &amp;#039;&amp;#039;&amp;#039;Dialog&amp;#039;&amp;#039;&amp;#039; type and write a name. We have chosen the name &amp;#039;&amp;#039;&amp;#039;firstDialog&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:GUI_Package_firstDialog.png]]&lt;br /&gt;
&lt;br /&gt;
After pressing &amp;#039;&amp;#039;&amp;#039;Create&amp;#039;&amp;#039;&amp;#039; button you will be prompted to set attributes for the new dialog. You can keep default initial attributes at creation time and change the necessary attributes later.&lt;br /&gt;
&lt;br /&gt;
The new dialog should be invoked on some event, therefore we modify &amp;#039;&amp;#039;&amp;#039;TaskMenu&amp;#039;&amp;#039;&amp;#039; menu by changing &amp;#039;&amp;#039;&amp;#039;File | New&amp;#039;&amp;#039;&amp;#039; text and making it enabled:&lt;br /&gt;
&lt;br /&gt;
[[Image:GUI_Package_TaskMenu.png]]&lt;br /&gt;
&lt;br /&gt;
Now we should put focus on the &amp;#039;&amp;#039;&amp;#039;TaskWindow\TaskWindow.win&amp;#039;&amp;#039;&amp;#039; window in &amp;#039;&amp;#039;&amp;#039;Project&amp;#039;&amp;#039;&amp;#039; window and activate &amp;#039;&amp;#039;&amp;#039;Code Experts&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:GUI_Package_NewDlgEvent.png]]&lt;br /&gt;
&lt;br /&gt;
After pressing &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; button the IDE will generate a default code for &amp;#039;&amp;#039;&amp;#039;onFileNewDialog&amp;#039;&amp;#039;&amp;#039; event. Let us modify it by invocation of &amp;#039;&amp;#039;&amp;#039;firstDialog&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    onFileNew : window::menuItemListener.&lt;br /&gt;
clauses&lt;br /&gt;
    onFileNew(_Source, _MenuTag):-&lt;br /&gt;
        FirstGuiDialog = firstDialog::new(This),&lt;br /&gt;
        FirstGuiDialog:show().&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run the application now and see that the &amp;#039;&amp;#039;&amp;#039;firstDialog&amp;#039;&amp;#039;&amp;#039; can be invoked.&lt;br /&gt;
&lt;br /&gt;
==How to Manipulate Controls in GUI Dialog or Form==&lt;br /&gt;
&lt;br /&gt;
Let us create two edit controls &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;EditCopy&amp;#039;&amp;#039;&amp;#039; in &amp;#039;&amp;#039;&amp;#039;firstDialog&amp;#039;&amp;#039;&amp;#039; and update the contents of &amp;#039;&amp;#039;&amp;#039;EditCopy&amp;#039;&amp;#039;&amp;#039; on all changes in the contents of &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We should also add event handling for &amp;#039;&amp;#039;&amp;#039;onModify&amp;#039;&amp;#039;&amp;#039; event of &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; control. To do this we put focus on the &amp;#039;&amp;#039;&amp;#039;TaskWindow\firstDialog.dlg&amp;#039;&amp;#039;&amp;#039; dialog in &amp;#039;&amp;#039;&amp;#039;Project&amp;#039;&amp;#039;&amp;#039; window and choose &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:GUI_Package_EditModifyEvent.png]]&lt;br /&gt;
&lt;br /&gt;
Then we can add the code to implement our intention:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;predicates&lt;br /&gt;
    onEditModified : editControl::modifiedListener.&lt;br /&gt;
clauses&lt;br /&gt;
    onEditModified(_Source) :-&lt;br /&gt;
        editCopy_ctl:setText(edit_ctl:getText()).&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us add a more complicated control now. Let us choose treeViewControl. IDE can insert automatically the necessary declarations, therefore we add &amp;#039;&amp;#039;&amp;#039;pfc\gui\treeViewControl\treeViewControl.pack&amp;#039;&amp;#039;&amp;#039; package and then build our project.&lt;br /&gt;
&lt;br /&gt;
In dialog editor we choose &amp;#039;&amp;#039;&amp;#039;Controls | Custom&amp;#039;&amp;#039;&amp;#039; command and select &amp;#039;&amp;#039;&amp;#039;treeViewControl&amp;#039;&amp;#039;&amp;#039; in the list.&lt;br /&gt;
&lt;br /&gt;
You can run the project now and see that the tree is empty. Let us modify the implementation of the constructor &amp;#039;&amp;#039;&amp;#039;new&amp;#039;&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;&amp;#039;TaskWindow\firstDialog.pro&amp;#039;&amp;#039;&amp;#039; file. Here, we can add more code to initialize the tree view control:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;constants&lt;br /&gt;
    myItemId = 10.&lt;br /&gt;
    myItemIdChild = 11.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    new(Parent) :-&lt;br /&gt;
        dialog::new(Parent),&lt;br /&gt;
        generatedInitialize(),&lt;br /&gt;
        treeViewControl_ctl:insertItem(myItemId, treeViewControl::wcc_null,&lt;br /&gt;
           treeViewControl::sorted(),&lt;br /&gt;
           &amp;quot;Root&amp;quot;,&lt;br /&gt;
           [], resId(resourceIdentifiers::idb_HelpBitmap), resId(resourceIdentifiers::idb_HelpBitmap)),&lt;br /&gt;
        treeViewControl_ctl:insertItem(myItemIdChild, myItemId,&lt;br /&gt;
           treeViewControl::sorted(),&lt;br /&gt;
           &amp;quot;Child&amp;quot;,&lt;br /&gt;
           [], resId(resourceIdentifiers::idb_HelpBitmap), resId(resourceIdentifiers::idb_HelpBitmap)).&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the program can show a simple tree.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:GUI]]&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_EditModifyEvent.png&amp;diff=1212</id>
		<title>File:GUI Package EditModifyEvent.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_EditModifyEvent.png&amp;diff=1212"/>
		<updated>2008-09-30T13:17:57Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: uploaded a new version of &amp;quot;Image:GUI Package EditModifyEvent.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI Package 07&lt;br /&gt;
&lt;br /&gt;
{{Tutorial Image}}&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_NewDlgEvent.png&amp;diff=1211</id>
		<title>File:GUI Package NewDlgEvent.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_NewDlgEvent.png&amp;diff=1211"/>
		<updated>2008-09-30T13:05:48Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: uploaded a new version of &amp;quot;Image:GUI Package NewDlgEvent.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI Package 06&lt;br /&gt;
&lt;br /&gt;
{{Tutorial Image}}&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_TaskMenu.png&amp;diff=1210</id>
		<title>File:GUI Package TaskMenu.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_TaskMenu.png&amp;diff=1210"/>
		<updated>2008-09-30T13:04:00Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: uploaded a new version of &amp;quot;Image:GUI Package TaskMenu.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI Package 05&lt;br /&gt;
&lt;br /&gt;
{{Tutorial Image}}&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_firstDialog.png&amp;diff=1209</id>
		<title>File:GUI Package firstDialog.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_firstDialog.png&amp;diff=1209"/>
		<updated>2008-09-30T13:00:29Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: uploaded a new version of &amp;quot;Image:GUI Package firstDialog.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI Package 04&lt;br /&gt;
&lt;br /&gt;
{{Tutorial Image}}&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_WindowAttributes.png&amp;diff=1208</id>
		<title>File:GUI Package WindowAttributes.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_WindowAttributes.png&amp;diff=1208"/>
		<updated>2008-09-30T12:59:30Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: uploaded a new version of &amp;quot;Image:GUI Package WindowAttributes.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI Package 03&lt;br /&gt;
&lt;br /&gt;
{{Tutorial Image}}&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_Project_tree2.png&amp;diff=1207</id>
		<title>File:GUI Package Project tree2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_Project_tree2.png&amp;diff=1207"/>
		<updated>2008-09-30T12:10:59Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: uploaded a new version of &amp;quot;Image:GUI Package Project tree2.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI Package 02&lt;br /&gt;
&lt;br /&gt;
{{Tutorial Image}}&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_Project_tree0.png&amp;diff=1206</id>
		<title>File:GUI Package Project tree0.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=File:GUI_Package_Project_tree0.png&amp;diff=1206"/>
		<updated>2008-09-30T12:09:29Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: uploaded a new version of &amp;quot;Image:GUI Package Project tree0.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI Package 01&lt;br /&gt;
&lt;br /&gt;
{{Tutorial Image}}&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Ide/Key_Bindings&amp;diff=1205</id>
		<title>Ide/Key Bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Ide/Key_Bindings&amp;diff=1205"/>
		<updated>2008-09-30T11:32:03Z</updated>

		<summary type="html">&lt;p&gt;VitalyBuylov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A number of Visual Prolog menu entries have accelerator keys (hot keys) associated with them.&lt;br /&gt;
&lt;br /&gt;
Beginning with Visual Prolog 7.0 some key binding have been changed to comply with Microsoft de facto standards. &lt;br /&gt;
The table below shows Visual Prolog 7.0 accelerator keys by functions.&lt;br /&gt;
&lt;br /&gt;
:{| {{prettytable}}&lt;br /&gt;
|- class=&amp;quot;header2&amp;quot;&lt;br /&gt;
|align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Function&lt;br /&gt;
|align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Key&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Edit&lt;br /&gt;
|-&lt;br /&gt;
| Copy&lt;br /&gt;
| Ctrl-C&lt;br /&gt;
|-&lt;br /&gt;
| Cut&lt;br /&gt;
| Ctrl-X&lt;br /&gt;
|-&lt;br /&gt;
| Paste&lt;br /&gt;
| Ctrl-V&lt;br /&gt;
|-&lt;br /&gt;
| Paste&lt;br /&gt;
| Ctrl-Ins&lt;br /&gt;
|-&lt;br /&gt;
| Undo&lt;br /&gt;
| Ctrl-Z&lt;br /&gt;
|-&lt;br /&gt;
| Redo&lt;br /&gt;
| Ctrl-Y&lt;br /&gt;
|-&lt;br /&gt;
| Redo&lt;br /&gt;
| Ctrl-Shift-Z&lt;br /&gt;
|-&lt;br /&gt;
| Select All&lt;br /&gt;
| Ctrl-A&lt;br /&gt;
|-&lt;br /&gt;
| Select Current Word&lt;br /&gt;
| Ctrl-W&lt;br /&gt;
|-&lt;br /&gt;
| Box Editor: Size To Content&lt;br /&gt;
| Shift-F6&lt;br /&gt;
|-&lt;br /&gt;
| Code Expert&lt;br /&gt;
| Ctrl+Shift+W&lt;br /&gt;
|-&lt;br /&gt;
| Delete Line&lt;br /&gt;
| Ctrl-Shift-L&lt;br /&gt;
|-&lt;br /&gt;
| Delete the current line&lt;br /&gt;
| Ctrl-K&lt;br /&gt;
|-&lt;br /&gt;
| Delete to End of Line&lt;br /&gt;
| Ctrl-Shift-E&lt;br /&gt;
|-&lt;br /&gt;
| Word Delete To End&lt;br /&gt;
Delete Object from Facts Tree&lt;br /&gt;
Retract Fact(s)&lt;br /&gt;
| Ctrl-Del&lt;br /&gt;
|-&lt;br /&gt;
| Insert Predicate&lt;br /&gt;
| Ctrl-Shift-I&lt;br /&gt;
|-&lt;br /&gt;
| Replace&lt;br /&gt;
| Ctrl-H&lt;br /&gt;
|-&lt;br /&gt;
| Lower Case&lt;br /&gt;
| Ctrl-U&lt;br /&gt;
|-&lt;br /&gt;
| Upper Case&lt;br /&gt;
| Ctrl-Shift-U&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Case&lt;br /&gt;
| Ctrl-Alt-U&lt;br /&gt;
|-&lt;br /&gt;
| Zoom In&lt;br /&gt;
| Ctrl-[+] or Ctrl-Scroll mouse wheel up&lt;br /&gt;
|-&lt;br /&gt;
| Zoom Out&lt;br /&gt;
| Ctrl-[-] or Ctrl-Scroll mouse wheel down&lt;br /&gt;
|-&lt;br /&gt;
| Zoom to Normal&lt;br /&gt;
| Ctrl-0&lt;br /&gt;
|-&lt;br /&gt;
| Comment Line(s)&lt;br /&gt;
| Ctrl-Alt-5&lt;br /&gt;
|-&lt;br /&gt;
| Uncomment Line(s)&lt;br /&gt;
| Ctrl-Alt-Shift-5&lt;br /&gt;
|-&lt;br /&gt;
| Insert Date Stamp&lt;br /&gt;
| Ctrl-Shift-Y&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Navigation&lt;br /&gt;
|-&lt;br /&gt;
| Find&lt;br /&gt;
| Ctrl-F&lt;br /&gt;
|-&lt;br /&gt;
| Find in Files&lt;br /&gt;
| Ctrl-Shift-F&lt;br /&gt;
|-&lt;br /&gt;
| Find Next&lt;br /&gt;
| F3&lt;br /&gt;
|-&lt;br /&gt;
| Locate in Project Tree&lt;br /&gt;
| Ctrl-T&lt;br /&gt;
|-&lt;br /&gt;
| View Current Position&lt;br /&gt;
| Shift-F4&lt;br /&gt;
|-&lt;br /&gt;
| Go Back&lt;br /&gt;
| Ctrl+Shift+F8&lt;br /&gt;
|-&lt;br /&gt;
| Go to Address&lt;br /&gt;
| Ctrl-G&lt;br /&gt;
|-&lt;br /&gt;
| Go to Definition&lt;br /&gt;
| F12&lt;br /&gt;
Ctrl-Shift-C&lt;br /&gt;
|-&lt;br /&gt;
| Go To Declaration&lt;br /&gt;
| Ctrl-F12&lt;br /&gt;
Ctrl-Shift-D&lt;br /&gt;
|-&lt;br /&gt;
| Go To Definition&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Go to Executing Predicate Source&lt;br /&gt;
| Ctrl-E&lt;br /&gt;
|-&lt;br /&gt;
| Go To Facts Database&lt;br /&gt;
| Ctrl+Alt+F&lt;br /&gt;
|-&lt;br /&gt;
| Go To Line&lt;br /&gt;
| Ctrl-F2&lt;br /&gt;
|-&lt;br /&gt;
| Go To Next Error&lt;br /&gt;
| F8&lt;br /&gt;
|-&lt;br /&gt;
| Go To Position on Clipboard&lt;br /&gt;
| Shift-F2&lt;br /&gt;
|-&lt;br /&gt;
| Go To Previous Error&lt;br /&gt;
| Shift-F8&lt;br /&gt;
|-&lt;br /&gt;
| Window Navigation Dialog&lt;br /&gt;
| Ctrl-Tab or Ctrl-F6&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Compile&lt;br /&gt;
|-&lt;br /&gt;
| Build&lt;br /&gt;
| Ctrl-Shift-B&lt;br /&gt;
|-&lt;br /&gt;
| Stop Build&lt;br /&gt;
| Ctrl-Break&lt;br /&gt;
|-&lt;br /&gt;
| Build Resource Only&lt;br /&gt;
| Alt-F8&lt;br /&gt;
|-&lt;br /&gt;
| Compile&lt;br /&gt;
| Ctrl-F7&lt;br /&gt;
|-&lt;br /&gt;
| Rebuild Project&lt;br /&gt;
| Ctrl-Shift-Alt-B&lt;br /&gt;
|-&lt;br /&gt;
| Run&lt;br /&gt;
| Ctrl-F5&lt;br /&gt;
|-&lt;br /&gt;
| Run in Window&lt;br /&gt;
| Alt-F5&lt;br /&gt;
|-&lt;br /&gt;
| Locate in Project Tree&lt;br /&gt;
| Ctrl-T&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Debug&lt;br /&gt;
|-&lt;br /&gt;
| Start Debugging &lt;br /&gt;
| F5&lt;br /&gt;
|-&lt;br /&gt;
| Stop Debugging&lt;br /&gt;
| Shift-F5&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoint Properties&lt;br /&gt;
| Alt-F9&lt;br /&gt;
|-&lt;br /&gt;
| Refresh Debug Window&lt;br /&gt;
| Ctrl-R&lt;br /&gt;
|-&lt;br /&gt;
| Registers window&lt;br /&gt;
| Ctrl-Alt-G&lt;br /&gt;
|-&lt;br /&gt;
| Breakpoints Window&lt;br /&gt;
| Ctrl-Alt-B&lt;br /&gt;
|-&lt;br /&gt;
| CallStack Window&lt;br /&gt;
| Ctrl-Alt-C&lt;br /&gt;
|-&lt;br /&gt;
| Disassembly Window&lt;br /&gt;
| Ctrl-Alt-D&lt;br /&gt;
|-&lt;br /&gt;
| Variable window&lt;br /&gt;
| Ctrl-Alt-V&lt;br /&gt;
|-&lt;br /&gt;
| Memory Dump 1 Window&lt;br /&gt;
| Ctrl-Alt-M&lt;br /&gt;
|-&lt;br /&gt;
| Threads Window&lt;br /&gt;
| Ctrl-Alt-H&lt;br /&gt;
|-&lt;br /&gt;
| Enable Breakpoint&lt;br /&gt;
| Ctrl-F9&lt;br /&gt;
|-&lt;br /&gt;
| Toggle Breakpoint&lt;br /&gt;
| F9&lt;br /&gt;
|-&lt;br /&gt;
| Step Into&lt;br /&gt;
| F11&lt;br /&gt;
|-&lt;br /&gt;
| Step out of&lt;br /&gt;
| Shift-F11&lt;br /&gt;
|-&lt;br /&gt;
| Step Over&lt;br /&gt;
| F10&lt;br /&gt;
|-&lt;br /&gt;
| Run To Cursor&lt;br /&gt;
| Ctrl-F10&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Project&lt;br /&gt;
|-&lt;br /&gt;
| New Project&lt;br /&gt;
| Ctrl-Shift-N&lt;br /&gt;
|-&lt;br /&gt;
| Open Project&lt;br /&gt;
| Ctrl-Shift-O&lt;br /&gt;
|-&lt;br /&gt;
| Add Module to Project&lt;br /&gt;
| Ctrl-Shift-A&lt;br /&gt;
|-&lt;br /&gt;
| Create Project Item&lt;br /&gt;
| Ctrl-N&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
IDE&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;quot;Qualification…&amp;amp;quot; Dialog&lt;br /&gt;
| Ctrl-Shift-S&lt;br /&gt;
|-&lt;br /&gt;
| Close all Editors&lt;br /&gt;
| Ctrl+Q&lt;br /&gt;
|-&lt;br /&gt;
| Close all Inactive Editors&lt;br /&gt;
| Ctrl+Shift+Q&lt;br /&gt;
|-&lt;br /&gt;
| Close the active window&lt;br /&gt;
| Ctrl-F4&lt;br /&gt;
|-&lt;br /&gt;
| Project window&lt;br /&gt;
| Ctrl-Alt-P&lt;br /&gt;
|-&lt;br /&gt;
| Project Settings&lt;br /&gt;
| Alt-F7&lt;br /&gt;
|-&lt;br /&gt;
| Save File&lt;br /&gt;
| F2&lt;br /&gt;
|-&lt;br /&gt;
| Save Project&lt;br /&gt;
| Ctrl-S&lt;br /&gt;
|-&lt;br /&gt;
| Source Browser&lt;br /&gt;
| Ctrl-B&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#cee0f2; text-align:center; font-weight:bold; color: #006B9C;&amp;quot; |&lt;br /&gt;
Other&lt;br /&gt;
|-&lt;br /&gt;
| Help&lt;br /&gt;
| F1&lt;br /&gt;
|-&lt;br /&gt;
| Output&lt;br /&gt;
| Ctrl-Alt-O&lt;br /&gt;
|-&lt;br /&gt;
| Print&lt;br /&gt;
| Ctrl-P&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ru:IDE:Горячие Клавиши]]&lt;br /&gt;
&lt;br /&gt;
[[Category:IDE]]&lt;/div&gt;</summary>
		<author><name>VitalyBuylov</name></author>
	</entry>
</feed>