Discussions related to Visual Prolog
User avatar
Gukalov
Active Member
Posts: 38
Joined: 5 Oct 2011 15:16

Fact initialization with if/then/else

Unread post by Gukalov »

Impossible to initialize a fact using if/then/else expression.
It works if decorate the expression to a function.

Code: Select all

implement justClass class facts     fact1 : unsigned := erroneous. facts     fact2 : unsigned := %        if isErroneous(fact1) then 100 else fact1 end if.    % error c150 : Syntax error         { = if isErroneous(fact1) then 100 else fact1 end if}().  % O'k end implement justClass   class justClass : justClass properties     fact1 : unsigned. end class justClass   interface justClass properties     fact2 : unsigned. end interface justClass
Is it right?

Thank you.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1285
Joined: 28 Feb 2000 0:01

Re: Fact initialization with if/then/else

Unread post by Thomas Linder Puls »

This problem does not exist in Visual Prolog 10.
Regards Thomas Linder Puls
PDC
Post Reply