Bug in arrayM_boolean

Discussions related to Visual Prolog
Vitaly Markov
VIP Member
Posts: 67
Joined: 30 Nov 2003 0:01

Bug in arrayM_boolean

Unread post by Vitaly Markov » 14 Apr 2013 17:16

Hi
There is a bug in implementation of class arrayM_boolean.
It is impossible to clear bit in array by the predicates set(Index,false) and clear(Index).
I propose new edition of predicate set(Idx, Value) in the file arrayM_boolean.pro:

Code: Select all

clauses set(Idx, Value) :-     Index = Idx div byteSize,     % ByteIndex in array     Byte = binary::getIndexed_unsigned8(bin, Index),   % Byte from array     Mask = bit::bitLeft(1, Idx mod byteSize),    (Value = true,!,     NByte = bit::bitOr(Mask, Byte);    % set of bit     Mask1 = bit::bitNot(Mask),     NByte = bit::bitAnd(Mask1, Byte)),   % clear of bit     binary::setIndexed_unsigned8(bin, Index, NByte).

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

Unread post by Thomas Linder Puls » 14 Apr 2013 18:44

Thank you, you are absolutely right. We will of course fix it.
Regards Thomas Linder Puls
PDC

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

Unread post by Thomas Linder Puls » 4 Jun 2013 7:53

This is fixed in Build 7402. IDE: Web -> Check for updates...
Regards Thomas Linder Puls
PDC

Post Reply