I am not sure how simple it is. But this is how I belive you can do it.
First you create a new project in a new location, but with the old name and kind (GUI/Console+DLL/EXE).
From this new project you copy the .prj6 file to the old project.
Then you open the old project (new .prj6 file). If the IDE complain about missing packages you should most likely accept to remove them from the project.
Next you should build the project and accept to add required files.
You may need to add additional include directories (there is no easy way to figure out what they should be).
Hopefully this will add all necessary .pack files, but if the project lacks #requires directives you may need to add additional packages manually (you wont know which untill you can link the program).
Now all that remains is the hardest part : adding required ressources and giving them the correct identifiers.
If for example you get an error stating that idb_stop is an unknown identifier, then it is likely that you need to add a bitmap file (idb_stop) named stop.bmp (idb_stop) to the project and make sure that its identifier becomes idb_stop.
Phew!!
That wasn't easy, considering I've been away from Visual Prolog since 2008!
I'm probably now very close to recreating the program, but I've run into a type mismatch, which I don't quite understand, as this project compiled properly 5 yeras ago.
Excuse the long listing, I'll highlight the 2 lines in question, goto %HERE IS THE PROBLEMATIC PART:
clauses
% arity /4
sqlServerRetrieveRows(CONN,AVD,MND,YR):-
searchCriteria(AVD,NYAVD),
searchCriteria(MND,NYMND),
searchCriteria(YR,NYYR),
S = odbcStatement::new(CONN),
SQLSTR = string::format("Select hendelser.refno, hendelser.infek, medisin.id_refno, medisin.antibio, medisin.adm_form, medisin.ordenstall"
" from hendelser, medisin"
" where (hendelser.avd %' and hendelser.mnd %' and hendelser.yr %' and hendelser.refno = medisin.id_refno)"
" order by hendelser.refno, medisin.ordenstall", NYAVD,NYMND,NYYR),
S:prepare(SQLSTR),
S:execute(),
%HERE IS THE PROBLEMATIC PART:
NumCols = S:numResultCols(), %NumCols is domain: fieldIndex)
foreach S:fetch_nd() do
foreach COL = convert(core::positive, programControl::sequence_multi(1, NumCols)) do %NumCols should be domain: integer)
ColName = S:colAttribute_string(COL, odbc_native::sql_desc_name),
ColValue = S:getColumnValue(COL),
CVAL = putBirthMark(ColName,ColValue),
filterOut(ColName,NEWC), % Filter out some ColNames, except those indicated in clauses
resultStr=STR,
resultStr := string::format("%s %s%s", STR, NEWC, printimage(CVAL))
end foreach
end foreach, %printImage(string(S)) = S. % already a string
S:closeCursor(),
S:free().
I thought the convert(core::positive, programControl::sequence_multi(1, NumCols)) took care of the conversion???
NumCols = S:numResultCols(),
foreach S:fetch_nd() do foreach COL = convert(core::positive, programControl::sequence_multi(1, convert(integer, NumCols)))do
ColName = S:colAttribute_string(COL, odbc_native::sql_desc_name),
....but I had to do a couple of more changes:
NumCols = S:numResultCols(),foreach S:fetch_nd() do foreach COL = convert(odbc_native::fieldIndex, std::fromTo(1, convert(integer, NumCols))) do
ColName = S:colAttribute_string(COL, odbc_native::sql_desc_name),
So now the program builds and executes!!!! (on this machine, a development machine)
5 years ago I built the app on another machine. I now get a warning that the OS now isn't compatible, maybe thats why I had to do all those conversions and substitute programControl::sequence_multi with std::fromTo. ???
I still don't know if the program will run flawlessly on the production-machine, where the main SQL-server database is locate d. But thats a database problem, not a VIP-problem.
I'm very grateful for your kind help! Warning: this autumn I'll develop yet another application - so I'll be back !