Difference between revisions of "Visual Prolog 8 Upgrade Notes"

From wiki.visual-prolog.com

(initial)
 
m (link)
 
(4 intermediate revisions by the same user not shown)
Line 12: Line 12:
'''Notice''' it is highly advisable to have a backup of a project before updating.
'''Notice''' it is highly advisable to have a backup of a project before updating.


After loading the project you should rebuild the entire project with the help of the '''Build | Rebuild All command''' and answer "Yes to All" to the messages suggesting adding or removing packages and include statements.  You may have to build again several times to complete the build process.
After loading the project you should rebuild the entire project with the help of the '''Build -> Rebuild All''' command and answer '''Yes All''' or to all to the messages suggesting adding or removing packages and include statements.  You may have to build again several times to complete the build process.


Notice that you should simply delete include directives to PFC files which cannot be found: proper include directives will (normally) be inserted automatically.
Notice that you should simply delete include directives to PFC files which cannot be found: proper include directives will (normally) be inserted automatically.
Line 21: Line 21:
* Delete all include directives for files that does not exist
* Delete all include directives for files that does not exist
* Accept to add include directives
* Accept to add include directives
It is reccomended that you continue the process above untill process stabilizes, before you start performing any manual updates.


== Manual updates ==
== Manual updates ==


<<under construction>>
=== event0 - event7 ===
 
The most severe change is that the <vp>Source</vp> parameter has been removed from all the polymorphic classes/interfaces <vp>event0</vp> - <vp>event7</vp>.  And that the corresponding listeners does not have a <vp>Source</vp> argument any more.
 
{{Example|
So a property like this:
 
<vip>
facts
    changed : event0{vipProject} := event0::new(This).
</vip>
 
must be changed like this
 
<vip>
facts
    changed : event0 := event0::new().
</vip>
}}
 
It is more difficult to change the listeners.
 
{{Example|
Code like this:
<vip>
P:changed:addListener(listView_changedItem),
</vip>
May give an error like this:
<pre>
The flow pattern '()' does not exist for 'listView_changedItem/1'
</pre>
This is because listView_changedItem/1 is a listener that expects a source argument (<vp>P</vp>):
 
<vip>
predicates
    listView_changedItem : (vipProject Project).
</vip>
 
In many cases the source argument is not used anyway:
 
<vip>
clauses
    listView_changedItem(_Project) :-
        ...
</vip>
 
In which case the predicate should simply "loose" the source arguments:
 
<vip>
predicates
    listView_changedItem : ().
clauses
    listView_changedItem() :-
        ...
</vip>
 
However if the source argument is actually used:
 
<vip>
predicates
    listView_changedItem : (vipProject).
clauses
    listView_changedItem(P) :-
        listViewControl_ctl:setItem(vipProjectToListViewItem(P)).
</vip>
 
Then it can obviously not just be deleted.  Instead it may be possible to capture the "Source" in an anonymous predicate where the listener is added.  Here the original code looked like this:
 
<vip>
P:changed:addListener(listView_changedItem),
</vip>
 
and it is <vp>P</vp> which is the source of the <vp>changed</vp> event, so we can change the code like this:
 
<vip>
P:changed:addListener({ :- listView_changedItem(P) }),
</vip>
 
The anonymous predicate <vp>{ :- listView_changedItem(P) }</vp> captures the source <vp>P</vp> and transfers it to <vp>listView_changedItem</vp>
}}


== See also ==
== See also ==


* [[New Features in Visual Prolog 8]]
* [[Visual Prolog 8 New Features]]
* [[Visual Prolog 7.5 Upgrade Notes]]
* [[Visual Prolog 7.5 Upgrade Notes]]


[[Category:Release Notes]]
[[Category:Release Notes|8 Upgrade Notes]]

Latest revision as of 14:50, 27 February 2019

This document describes how to upgrade Visual Prolog 7.5 projects to Visual Prolog 8, for older projects you should also read Visual Prolog 7.5 Upgrade Notes.

If you have problems with upgrading your projects and need additional information, you are welcome to ask questions in Visual Prolog Discussion Forum.

By default, the installation of Visual Prolog 8 will not replace any previously installed versions. It is possible to work with several versions on a single computer.

  • The Commercial Edition will by default be installed in C:\Program Files (x86)\Visual Prolog 8 or C:\Program Files\Visual Prolog 8.
  • The Personal Edition will by default be installed to C:\Program Files (x86)\Visual Prolog 8PE or C:\Program Files\Visual Prolog 8PE.

Visual Prolog 8 projects are backward-compatible with Visual Prolog 7.5 projects. If you are going to use different versions of Visual Prolog installed at one computer, avoid opening projects by double-clicking on vipprj files.

Notice it is highly advisable to have a backup of a project before updating.

After loading the project you should rebuild the entire project with the help of the Build -> Rebuild All command and answer Yes All or to all to the messages suggesting adding or removing packages and include statements. You may have to build again several times to complete the build process.

Notice that you should simply delete include directives to PFC files which cannot be found: proper include directives will (normally) be inserted automatically.

Many projects will only require:

  • Accept to remove all unexisting packages
  • Accept to add required packages
  • Delete all include directives for files that does not exist
  • Accept to add include directives

It is reccomended that you continue the process above untill process stabilizes, before you start performing any manual updates.

Manual updates

event0 - event7

The most severe change is that the Source parameter has been removed from all the polymorphic classes/interfaces event0 - event7. And that the corresponding listeners does not have a Source argument any more.

Example

So a property like this:

facts
    changed : event0{vipProject} := event0::new(This).

must be changed like this

facts
    changed : event0 := event0::new().

It is more difficult to change the listeners.

Example

Code like this:

P:changed:addListener(listView_changedItem),

May give an error like this:

The flow pattern '()' does not exist for 'listView_changedItem/1'

This is because listView_changedItem/1 is a listener that expects a source argument (P):

predicates
    listView_changedItem : (vipProject Project).

In many cases the source argument is not used anyway:

clauses
    listView_changedItem(_Project) :-
        ...

In which case the predicate should simply "loose" the source arguments:

predicates
    listView_changedItem : ().
clauses
    listView_changedItem() :-
        ...

However if the source argument is actually used:

predicates
    listView_changedItem : (vipProject).
clauses
    listView_changedItem(P) :-
        listViewControl_ctl:setItem(vipProjectToListViewItem(P)).

Then it can obviously not just be deleted. Instead it may be possible to capture the "Source" in an anonymous predicate where the listener is added. Here the original code looked like this:

P:changed:addListener(listView_changedItem),

and it is P which is the source of the changed event, so we can change the code like this:

P:changed:addListener({ :- listView_changedItem(P) }),

The anonymous predicate { :- listView_changedItem(P) } captures the source P and transfers it to listView_changedItem

See also