Re: Another option
This WebDNA talk-list message is from 2005
It keeps the original formatting.
numero = 63291
interpreted = N
texte = Yes it returns 1 2 3 4 when there are 4 items, No carrage returns but thatsnot a problem----- Original Message ----- From: "Clint Davis"
To: "WebDNA Talk" Sent: Tuesday, October 25, 2005 11:13 PMSubject: Re: Another option> Does this code return something like:> 1> 2> 3>> [loop start=1&end=[numlineitems]]> [index]> [/loop]>>> On 10/25/05 4:13 PM, "paul" wrote:>> > Hi> >> > If I use> >> > item[lineindex]=[math][TextE]*[quantity]*[price][/math]> >> > I get> >> > 1=29> > 2=33> > 3=12> >> > But I cannot get anyway of adding these together, the 2nd part of code> > returns nothing> >> > Going mad!! I think> >> > THanks> > Paul> > ----- Original Message -----> > From: "Clint Davis" > > To: "WebDNA Talk" > > Sent: Tuesday, October 25, 2005 10:21 PM> > Subject: Re: Another option> >> >> >> Here's the basic logic:> >>> >> 1. Set a math or text variable equal to> >> [math][TextE]*[quantity]*[price][/math]> >> 2. At the end of the lineitems list, add all those math/text variables> >> together to display a total.> >>> >> My code should create variables like item1=20.99 or item3=4.75> >>> >>> >> On 10/25/05 3:16 PM, "paul" wrote:> >>> >>> Hi Clint> >>>> >>> Fr some reason the code does not display a thing, I do not get a listof> > the> >>> line items or the totals> >>>> >>> I am going crazy here and cannot understand why nothing happens> >>>> >>> [math][index]=[TextE]*[quantity]*[price][/math] displays all thecorrect> >>> totals, just doesnt seem to wnat to set the variables with item[index]> >>>> >>>> >>> Any ideas?> >>>> >>> Many thanks> >>> Paul> >>>> >>>> >>> ----- Original Message -----> >>> From: "Clint Davis" > >>> To: "WebDNA Talk" > >>> Sent: Tuesday, October 25, 2005 9:55 PM> >>> Subject: Re: Another option> >>>> >>>> >>>> You could set a [math] variable for each lineitem with the price as> >>>> calculated below, then total those [math] variables at the end of the> >>>> [lineitems] loop. Try this:> >>>>> >>>> [!] display line items [/!]> >>>> [lineitems]> >>>> [math]item[index]=[TextE]*[quantity]*[price][/math]> >>>> [/lineitems]> >>>>> >>>> [!] display lineitems total [/!]> >>>> [loop start=1&end=[numlineitems]]> >>>> [math]itemsTotal=itemsTotal+item[index][/math]> >>>> [/loop]> >>>>> >>>>> >>>> On 10/25/05 2:35 PM, "paul" wrote:> >>>>> >>>>> Yes the code works to a point> >>>>>> >>>>> it gives me the correct price of each item but I need to find a wayof> >>>>> totalling them, if I have 4 items in the cart it shows the 4 pricesas> > I> >>>>> need them but> >>>>>> >>>>> Cannot work out the code for that, I need to add up the list ofthese> >>> not> >>>>> just display them> >>>>>> >>>>> Help needed!!> >>>>>> >>>>> Thanks> >>>>> paul> >>>>>> >>>>>> >>>>> ----- Original Message -----> >>>>> From: "Clint Davis" > >>>>> To: "WebDNA Talk" > >>>>> Sent: Tuesday, October 25, 2005 9:19 PM> >>>>> Subject: Re: Another option> >>>>>> >>>>>> >>>>>> As long as you're inside an [orderfile] and [lineitems] loop, the> > math> >>> you> >>>>>> have below should work.> >>>>>>> >>>>>>> >>>>>> On 10/25/05 1:11 PM, "paul" wrote:> >>>>>>> >>>>>>> How can I just add up the contents of my shopping cart based onthe> >>>>>>> following> >>>>>>>> >>>>>>> Each items price is calculated by> >>>>> [math][TextE]*[quantity]*[price][/math]> >>>>>>>> >>>>>>> I just need to add these together for each line in the cart, I can> >>> list> >>>>> them> >>>>>>> but do not seem to be able to add them up> >>>>>>>> >>>>>>> How do I do this>>>> -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to> Web Archive of this list is at: http://webdna.smithmicro.com/>-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Yes it returns 1 2 3 4 when there are 4 items, No carrage returns but thatsnot a problem----- Original Message ----- From: "Clint Davis" To: "WebDNA Talk" Sent: Tuesday, October 25, 2005 11:13 PMSubject: Re: Another option> Does this code return something like:> 1> 2> 3>> [loop start=1&end=[numlineitems]]> [index]> [/loop]>>> On 10/25/05 4:13 PM, "paul" wrote:>> > Hi> >> > If I use> >> > item[lineindex]=[math][TextE]*[quantity]*[price][/math]> >> > I get> >> > 1=29> > 2=33> > 3=12> >> > But I cannot get anyway of adding these together, the 2nd part of code> > returns nothing> >> > Going mad!! I think> >> > THanks> > Paul> > ----- Original Message -----> > From: "Clint Davis" > > To: "WebDNA Talk" > > Sent: Tuesday, October 25, 2005 10:21 PM> > Subject: Re: Another option> >> >> >> Here's the basic logic:> >>> >> 1. Set a math or text variable equal to> >> [math][TextE]*[quantity]*[price][/math]> >> 2. At the end of the lineitems list, add all those math/text variables> >> together to display a total.> >>> >> My code should create variables like item1=20.99 or item3=4.75> >>> >>> >> On 10/25/05 3:16 PM, "paul" wrote:> >>> >>> Hi Clint> >>>> >>> Fr some reason the code does not display a thing, I do not get a listof> > the> >>> line items or the totals> >>>> >>> I am going crazy here and cannot understand why nothing happens> >>>> >>> [math][index]=[TextE]*[quantity]*[price][/math] displays all thecorrect> >>> totals, just doesnt seem to wnat to set the variables with item[index]> >>>> >>>> >>> Any ideas?> >>>> >>> Many thanks> >>> Paul> >>>> >>>> >>> ----- Original Message -----> >>> From: "Clint Davis" > >>> To: "WebDNA Talk" > >>> Sent: Tuesday, October 25, 2005 9:55 PM> >>> Subject: Re: Another option> >>>> >>>> >>>> You could set a [math] variable for each lineitem with the price as> >>>> calculated below, then total those [math] variables at the end of the> >>>> [lineitems] loop. Try this:> >>>>> >>>> [!] display line items [/!]> >>>> [lineitems]> >>>> [math]item[index]=[TextE]*[quantity]*[price][/math]> >>>> [/lineitems]> >>>>> >>>> [!] display lineitems total [/!]> >>>> [loop start=1&end=[numlineitems]]> >>>> [math]itemsTotal=itemsTotal+item[index][/math]> >>>> [/loop]> >>>>> >>>>> >>>> On 10/25/05 2:35 PM, "paul" wrote:> >>>>> >>>>> Yes the code works to a point> >>>>>> >>>>> it gives me the correct price of each item but I need to find a wayof> >>>>> totalling them, if I have 4 items in the cart it shows the 4 pricesas> > I> >>>>> need them but> >>>>>> >>>>> Cannot work out the code for that, I need to add up the list ofthese> >>> not> >>>>> just display them> >>>>>> >>>>> Help needed!!> >>>>>> >>>>> Thanks> >>>>> paul> >>>>>> >>>>>> >>>>> ----- Original Message -----> >>>>> From: "Clint Davis" > >>>>> To: "WebDNA Talk" > >>>>> Sent: Tuesday, October 25, 2005 9:19 PM> >>>>> Subject: Re: Another option> >>>>>> >>>>>> >>>>>> As long as you're inside an [orderfile] and [lineitems] loop, the> > math> >>> you> >>>>>> have below should work.> >>>>>>> >>>>>>> >>>>>> On 10/25/05 1:11 PM, "paul" wrote:> >>>>>>> >>>>>>> How can I just add up the contents of my shopping cart based onthe> >>>>>>> following> >>>>>>>> >>>>>>> Each items price is calculated by> >>>>> [math][TextE]*[quantity]*[price][/math]> >>>>>>>> >>>>>>> I just need to add these together for each line in the cart, I can> >>> list> >>>>> them> >>>>>>> but do not seem to be able to add them up> >>>>>>>> >>>>>>> How do I do this>>>> -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to> Web Archive of this list is at: http://webdna.smithmicro.com/>-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
"paul"
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
[WebDNA] OT: undeliverable messages? (2009)
Programmer Needed (1998)
Limits (2000)
Configuring E-mail (1997)
referrer variable (1997)
Tax Rates (1998)
webcat2b12 CGI -- Date comparisons (1997)
Server crash (1997)
[countwords] (2002)
RePost: NAT and the CART (1999)
Re[2]: when is failing to [URL]ize values in a comparison ri (1999)
WebCat2: Items xx to xx shown, etc. (1997)
Searchable WebCat (etc.) Docs ? (1997)
WebCat2b15MacPlugin - showing [math] (1997)
Problems reading files created by WC (1997)
Emailer Error 472? (2004)
Email (1998)
RequiredFields template (1997)
process SSI (1998)
Removing [showif] makes a big difference in speed (1997)