Re: Another try

estevedelacebo_at_gmail.com
Date: 02/07/05


Date: 7 Feb 2005 13:31:23 -0800

Hello. You are unifying the Price var with an anonymous var. Using a
single normal var instead of two anonymous ones would do the trick.

Regards

Esteve

Yereth Jansen wrote:
> Sorry for double posting, but my latest answer wasn't exactly useful
and
> I am in quite a hurry. Not of your concern perhaps, but the more for
me
> though.
> I know out of experience that people tend to skip posts that have
> replies already, so below another time my question:
>
> ---
>
> Hello,
>
> I have a problem with a prolog function I've written. The function is

> defined as followed:
>
> selectInStorage(
> part([A,B,C,Price1]),
> [part([A,B,C,Price2])|Tail],
> Tail,
> Price2
> ) :-
> Price2 =< Price1.
>
> selectInStorage(
> part([A1, B1, C1, D1]),
> [part([A2, B2, C2, D2]) | Tail],
> [part([A2, B2, C2, D2]) | Rest],
> _
> ) :-
> selectInStorage(
> part([A1, B1, C1, D1]),
> Tail,
> Rest,
> _
> ).
>
> This is the result of 2 tries in the commandline:
>
> 13 ?-
selectInStorage(part([a,b,c,500]),[part([a,b,c,450])],List,Price).
>
> List = []
> Price = 450
>
> Yes
> 14 ?-
selectInStorage(part([a,b,c,500]),[part([a,b,c,550])],List,Price).
>
> No
> 15 ?-
>
selectInStorage(part([a,b,c,500]),[part([a,b,c,550]),part([a,b,c,450])],List,Price).
>
> List = [part([a, b, c, 550])]
> Price = _G743
>
> Yes
>
> Now clearly, with the last result we are not getting the price we
want.
> The price should've been 450. He does find the right result, but does

> not output Price2 correctly. Anyone any clue what we are doing wrong
here?
>
> Thanks in advance,
> Yereth Jansen



Relevant Pages

  • Re: Extracting data from a form
    ... All right we want to incorpration the Quantity Value ... it will be assumed as zero. ... "price278" form fields value must be a valid number for the course price, ... var price = 0; ...
    (comp.lang.javascript)
  • Re: Javascript calc in asp.net page wrong
    ... For example, using a price of 415,000.00 ... and a Size of 11,200 in my 2 controls I am trying to calculate the ... My Javascript comes up with 37.73 and my calculator ... var otxtsaleprice = ...
    (microsoft.public.dotnet.framework.aspnet)
  • Currency code help
    ... something wrong with this javascript code. ... the american dollar and european equivalent of a price. ... a price in pounds, it gives me the price in dollars and euros. ... var endstring=thenumber.substring; ...
    (comp.lang.javascript)
  • Yet Another Newbie question
    ... I've been taking Web Design at the local Tech Skool ... description and price in arrays and use the push ... arrays when I list the items. ... var e_cart_descr; ...
    (comp.lang.java.help)
  • Yet Another Newbie Question
    ... I've been taking Web Design at the local Tech Skool ... description and price in arrays and use the push ... arrays when I list the items. ... var e_cart_descr; ...
    (comp.lang.javascript)