Problem with console::setLocation in vip 7.4

Discussions related to Visual Prolog
Elena Efimova
Active Member
Posts: 34
Joined: 1 Sep 2006 13:02

Problem with console::setLocation in vip 7.4

Unread post by Elena Efimova » 30 Nov 2012 5:59

Hello!

It does not work (32 bit).

User avatar
Thomas Linder Puls
VIP Member
Posts: 2422
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 2 Dec 2012 13:15

Hi Elena. Thank you. We will look at the problem (in fact I think you have been contacted with a solution).
Regards Thomas Linder Puls
PDC

Vitaly Markov
VIP Member
Posts: 67
Joined: 30 Nov 2003 0:01

Unread post by Vitaly Markov » 2 Dec 2012 19:21

The simple solution:

1) Modification of the declaration in file console_native.cl:

Code: Select all

predicates setConsoleCursorPosition : (fileHandle ConsoleOutputHandle, unsigned CursorPosition) -> booleanInt Result language apicall.
2) Modification of the implementation in file console.pro:

Code: Select all

clauses         setLocation(coord(X, Y)) :-         CoordU = bit::mkUnsigned32(X, Y),         Result = setConsoleCursorPosition(console_api::getStdHandle(stdOutput_handle), CoordU),         if Result = b_false then             LastError = exception::getLastError(),             exception::raise_NativeCallException("SetConsoleCursorPosition", LastError, [])         end if.
Works perfectly.
I wish good luck.

Elena Efimova
Active Member
Posts: 34
Joined: 1 Sep 2006 13:02

Unread post by Elena Efimova » 2 Dec 2012 19:45

Thank you! The problem has been solved. :-)

User avatar
Thomas Linder Puls
VIP Member
Posts: 2422
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 23 Jan 2013 14:12

This is solved in Visual Prolog 7.4 build 7401. To upgrade select Web -> Check for Updates in the IDE.
Regards Thomas Linder Puls
PDC

Post Reply