Release 5.1 of Visual Prolog is almost 100% compatible with release 4.0 and 4.1. We have added some new predicates, renamed a single predicate, carefully modified the behavior of a couple of VPI predicates and moved some VPI header files into subdirectories.
Before using the new Visual Prolog 5.1 please back up all your files to a safe place !
The main thing that will give compilation problems is that we moved the VPI header files from the VPI\INCLUDE directory down into the following subdirectories:
VPI\INCLUDE\DIALOG\DIALOG
VPI\INCLUDE\TREE\VPITREE
VPI\INCLUDE\MESSAGES\MESSAGES
VPI\INCLUDE\OWNDRAW\OWNDRAW
VPI\INCLUDE\TOOLBAR\TOOLBAR
If you compile an old project immediately after installation of VIP 5.1, you will get a number of error messages. To compile your project you must use one of the following strategies:
The file UPGRADE\VPI_OLD.BAT can perform this task. This is the easiest solution, and is maybe a good idea if you need to compile your 4.0 project for the first time.
If you add:
"VPI\INCLUDE\DIALOG; VPI\INCLUDE\TREE; VPI\INCLUDE\MESSAGES; VPI\INCLUDE\TOOLBAR; VPI\INCLUDE\OWNDRAW"
to the include path, the project will compile. However we recommend that the include path to the VPI is only VPI\INCLUDE, because there are several VPI tools in subdirectories,
We have supplied an upgrade program that can update your source code, so the includes will be modified from, for example,. "DIALOG.PRE" to "DIALOG\\DIALOG.PRE". However you should note that after this change you can not directly compile your project with Visual Prolog 4.0.
Visual Prolog 5.1 does not include the SLR OptLink linker, but instead the newly developed PDC linker !
To use the new linker in an old project, the scripts must be regenerated. The easiest way to do this is to change target to WIN32 and back to WIN16 again.
Together with the new fail detection possibility, we have gone through all the tools to see whether the tool predicates should be declared as a predicate or as a procedure (a predicate that can never fail). We have modified a couple of predicates in the dialog package, so these can no longer fail. If you are using the dialog_Get predicates and the specified control does not exist, you will now get a runtime error. To support runtime error reaction it is needed to add the inclusion of the ERROR.CON file to the Project module, which includes VPI TOOLS. It is generated default as the VPITOOLS.PRO file. Upgrade procedure makes it automatically.
The Grid tool has been considerably improved, however it is not fully backwards compatible. If you have used the 4.0 version please look in the \VPI\INCLUDE\GRID\DOC directory for upgrade notes.
The .HAM database must be converted from the 4.0 to 5.1 version using VIPCONV.EXE tool in two steps: converting to the text format and back.
Will now give a run-time error if the DDE cannot be initialized.
We have enhanced the default code generated for dialogs. If you have a dialog in your project, select Resource->Preview .PRO code to see the code we generate now.
If you move from a Visual Prolog 4.0 program, you should check calls to this predicate. The argument did not have any effect in VIP 4.0, but now it is implemented and makes a difference.
In VIP 4.0 this predicate returned a Zero if no Windows had focus. This was a dangerous behavior so now the predicate will exit in this situation. To be safe please make a search for all uses of this predicate.
Because it is now possible to specify the predicate type (determ, procedure etc.) before the flowpattern of a predicate, the syntax of the predicate declarations are now a bit more strict, but still compatible with the old documentation.
The new predicate types can give a syntax error in a few domain declarations, if a functor from the above names are used. The reason is conflict with the syntax of declaring a procedure domain like in:
EHANDLER = determ (WINDOW,EVENT,LONG); other_alternative
A quick workaround is to move this alternative to the back like in:
EHANDLER = other_alternative; determ (WINDOW,EVENT,LONG)
The event e_MouseMove carries an argument that specifies which MouseKeys are pressed while the mouse is being moved. The argument had no effect in VIP 4.0, but now it works, and the mouse keys are returned in a list.
Use the UPGRADE.EXE program to upgrade the source files of projects created with Visual Prolog 4.0 to the new VIP 5.1 include strategy
UPGRADE.EXE performs text substitutions in the source files. Additional substitutions that UPGRADE.EXE should perform may be specified in the UPGRADE.INP file. This file must be placed in the same directory as UPGRADE.EXE.
Each line of UPGRADE.INP corresponds to a single substitution. The following two formats can be used:
/*FIND/SUBSTITUTION/ replace all occurrences of FIND by SUBSTITUTION, /FIND/SUBSTITUTION/ replace all occurrences of FIND (treated as WHOLE word) by SUBSTITUTION.
UPGRADE.EXE [flags] [filenames]
filenames multiple filenames (separated by spaces) are supported, wild format can be used. If no filename is specified then UPGRADE.EXE uses:
*.PRO *.PRE *.CON *.DOM *.INC flags -i show information about each substitution -b beep after ending -p set the start directory for the search -d search in subdirectories -? help message
Suppose that C:\TEST directory contains a 4.0 project you want to upgrade. Take the following steps:
1) Change the current directory to:\UPGRADE 2) Type the command line: UPGRADE -i -d -pC:\TEST 3) Press
UPGRADE.EXE will use the default filenames ( *.PRO, *.PRE, *.CON, *.DOM, *.INC ), therefore, it will make substitutions in all files with these extensions that exist in the C:\TEST directory (and it's subdirectories). UPGRADE.EXE will report each substitution.