Re: Help on how to store calculated value

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 45433
interpreted = N
texte = It works!!!Using[math show=F]BW=0[lineitems]+[lookup db=admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=WEIGHT]*[quantity][/lineitems][/math]Thank you everyone!EricAt 09:24 PM 11/18/2002 -0800, you wrote: >Eric - > >If your initial calculation is indeed giving you the right calculated >value, then the code for it is fine and you just need to get the result >assigned to a math variable. Your math syntax, including the >[lineitems]+[lookup... looks fine to me, as long as you are within an >orderfile context. > >You may very well be within an IMPLIED orderfile context even if there is >no [orderfile] tag on your page - WebDNA automatically invokes an >orderfile context around a page when certain parameters are passed in. > >A simplified syntax for setting a math variable is: > >[math show=F]var=1+2[/math] > >Anywhere after that, specifying [var] will return 3. > >So, use: > >[math show=F]BW=0[lineitems]+[lookup >db=admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=WEIGHT]*[quantity][/lineitems][/math] > >then [BW] will hold your calculated value. > >You DO NOT need to add [orderfile cart=[cart]] to your page if the >calculation is already working - this may very well foul things up by >creating a new empty order file. > >- brian > >At 9:12 PM -0600 11/18/02, Eric wrote: >>Hi, >> >>I know this is easy but somehow I am brain dead. >> >>I have the following calculation and it gives the correct value >> >>[math]0[lineitems]+[lookup >>db=admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=WEIGHT]*[quantity][/lineitems][/math] >> >>I wish to store the results in a field (to be called BW) so that I can >>use this field to display the calculated data and for further calculation. >> >>I use >> >>[BW]=[math]0[lineitems]+[lookup >>db=admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=WEIGHT]*[quantity][/lineitems][/math] >> >>But it did not work. >> >>Can someone help?? >> >> >>Stuart suggested to use the following, >> >> >> >>[Orderfile file=file] >>[Math show=F]BW=0[lineitems]+([lookup >>db=admin/products.db&lookinfield=SKU&value=[url][sku][/ >>url]&returnfield=WEIGHT]*[quantity])[/lineitems][/Math] >>[/OrderFile] >> >>Then when you need the value call the Math variable .... >> >>Here is the total weight = [BW] >> >> >> >>but it did not work and gives the following error message: >> >>Error: Can't open order file. Ignoring [OrderFile] context >> >> >> >> >> >> >> >> >> >> >>------------------------------------------------------------- >>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://search.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://search.smithmicro.com/ > >-- >This message has been scanned for viruses and >dangerous content by MailScanner, and is >believed to be clean. >ow3------------------------------------------------------------- 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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Help on how to store calculated value (Eric 2002)
  2. Re: Help on how to store calculated value (Brian Fries 2002)
  3. Re: Help on how to store calculated value (Kalin Mintchev 2002)
  4. Re: Help on how to store calculated value (Kalin Mintchev 2002)
  5. Re: Help on how to store calculated value (Stuart Tremain 2002)
  6. Re: Help on how to store calculated value (Stuart Tremain 2002)
  7. Re: Help on how to store calculated value (Kalin Mintchev 2002)
  8. Re: Help on how to store calculated value (Eric 2002)
  9. Re: Help on how to store calculated value (Donovan Brooke 2002)
  10. Re: Help on how to store calculated value (Stuart Tremain 2002)
  11. Help on how to store calculated value (Eric 2002)
It works!!!Using[math show=F]BW=0[lineitems]+[lookup db=admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=WEIGHT]*[quantity][/lineitems][/math]Thank you everyone!EricAt 09:24 PM 11/18/2002 -0800, you wrote: >Eric - > >If your initial calculation is indeed giving you the right calculated >value, then the code for it is fine and you just need to get the result >assigned to a math variable. Your math syntax, including the >[lineitems]+[lookup... looks fine to me, as long as you are within an >orderfile context. > >You may very well be within an IMPLIED orderfile context even if there is >no [orderfile] tag on your page - WebDNA automatically invokes an >orderfile context around a page when certain parameters are passed in. > >A simplified syntax for setting a math variable is: > >[math show=F]var=1+2[/math] > >Anywhere after that, specifying [var] will return 3. > >So, use: > >[math show=F]BW=0[lineitems]+[lookup >db=admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=WEIGHT]*[quantity][/lineitems][/math] > >then [BW] will hold your calculated value. > >You DO NOT need to add [orderfile cart=[cart]] to your page if the >calculation is already working - this may very well foul things up by >creating a new empty order file. > >- brian > >At 9:12 PM -0600 11/18/02, Eric wrote: >>Hi, >> >>I know this is easy but somehow I am brain dead. >> >>I have the following calculation and it gives the correct value >> >>[math]0[lineitems]+[lookup >>db=admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=WEIGHT]*[quantity][/lineitems][/math] >> >>I wish to store the results in a field (to be called BW) so that I can >>use this field to display the calculated data and for further calculation. >> >>I use >> >>[BW]=[math]0[lineitems]+[lookup >>db=admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=WEIGHT]*[quantity][/lineitems][/math] >> >>But it did not work. >> >>Can someone help?? >> >> >>Stuart suggested to use the following, >> >> >> >>[Orderfile file=file] >>[Math show=F]BW=0[lineitems]+([lookup >>db=admin/products.db&lookinfield=SKU&value=[url][sku][/ >>url]&returnfield=WEIGHT]*[quantity])[/lineitems][/Math] >>[/OrderFile] >> >>Then when you need the value call the Math variable .... >> >>Here is the total weight = [BW] >> >> >> >>but it did not work and gives the following error message: >> >>Error: Can't open order file. Ignoring [orderfile] context >> >> >> >> >> >> >> >> >> >> >>------------------------------------------------------------- >>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://search.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://search.smithmicro.com/ > >-- >This message has been scanned for viruses and >dangerous content by MailScanner, and is >believed to be clean. >ow3------------------------------------------------------------- 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://search.smithmicro.com/ Eric

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:

Mail Server Needed. (1998) Tax on shipping (1998) [ConvertChars] problem (1997) OT- AS/400 and Macs (2003) WC2b15 File Corruption (1997) RE: 2nd WebCatalog2 Feature Request (1996) European Convention (2004) [WebDNA] WebDNA7 site randomly dropping tags (2011) SiteEdit NewFile.html ? (1997) Help-.html extention and Serial Number not working. (2000) hmmm (2006) Database Fields (1997) Windows-based Code Editor (2002) Why is my easy [AddLineItems] NOT working?? MORE (2000) Missing from Docs [folderName] (1997) Math Problem - Format? (1997) Single Link browsing (1997) 2.0Beta Command Ref (can't find this instruction) (1997) WebCatalog for guestbook ? (1997) unitshipcost vs shipcosts (1997)