Re: Trouble with formula.db + more explanation

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 10984
interpreted = N
texte = >Now, what is puzzling is the fact that the above formula works if I place >it in a .tmpl file (it results in displaying the calculated shipCost). >However, if I paste the exact same formula in the formulas.db for >shipCost it fails. So, is there some funny syntax incosistencies or >limits between .tmpl code and code for the formulas.db?No, there is no syntax difference....but the reason I was trying to simplify your formula was to reduce the number of nested tags. Since your formula works when embedded in a page, but not when in the formula database, I suspect that you're right at the 'edge' of nesting complexity -- formulas incur 1 extra nesting level of overhead. If you're using the plugin, try switching to CGI. If it suddenly works, then we'll know it was the nesting level.Also, I encourage you to try a simpler formula to start. Try the .5 lb section of your formula all by itself to see if it works. If it does, that's another clue about nesting level.If none of this works, try my 'rotated' database approach (from my earlier email) that reduces your formula quite a lot. A lot of the calculation is offloaded into the search process, and simply becomes a table lookup.MaxWeight canada china ireland japan 0.5 16.5 16.5 16.5 16.5 1 18.75 18.75 18.75 18.75 2 22.5 22.5 22.5 22.5 3 26.5 26.5 26.5 26.5 4 30 30 30 30 5 34 34 34 34 6 37.75 37.75 37.75 37.75 7 41.5 41.5 41.5 41.5 . . . 1000 3765.25 3765.25 3765.25 3765.25Fill in the lines from 8-999 with ascending values (last line+3.75). It may seem like a huge database, but it takes up very little RAM.Finally, you can send me your templates and database so I can run your formula through the debugger and catch it in the act.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court, #453 | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Associated Messages, from the most recent to the oldest:

    
>Now, what is puzzling is the fact that the above formula works if I place >it in a .tmpl file (it results in displaying the calculated shipCost). >However, if I paste the exact same formula in the formulas.db for >shipCost it fails. So, is there some funny syntax incosistencies or >limits between .tmpl code and code for the formulas.db?No, there is no syntax difference....but the reason I was trying to simplify your formula was to reduce the number of nested tags. Since your formula works when embedded in a page, but not when in the formula database, I suspect that you're right at the 'edge' of nesting complexity -- formulas incur 1 extra nesting level of overhead. If you're using the plugin, try switching to CGI. If it suddenly works, then we'll know it was the nesting level.Also, I encourage you to try a simpler formula to start. Try the .5 lb section of your formula all by itself to see if it works. If it does, that's another clue about nesting level.If none of this works, try my 'rotated' database approach (from my earlier email) that reduces your formula quite a lot. A lot of the calculation is offloaded into the search process, and simply becomes a table lookup.MaxWeight canada china ireland japan 0.5 16.5 16.5 16.5 16.5 1 18.75 18.75 18.75 18.75 2 22.5 22.5 22.5 22.5 3 26.5 26.5 26.5 26.5 4 30 30 30 30 5 34 34 34 34 6 37.75 37.75 37.75 37.75 7 41.5 41.5 41.5 41.5 . . . 1000 3765.25 3765.25 3765.25 3765.25Fill in the lines from 8-999 with ascending values (last line+3.75). It may seem like a huge database, but it takes up very little RAM.Finally, you can send me your templates and database so I can run your formula through the debugger and catch it in the act.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court, #453 | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Grant Hulbert

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:

WebCatalog and Dreamweaver (1999) OT : javascript form filling (2000) HELP! Search finding too much! (1998) Emailer (WebCat2) (1997) PIXO support (1997) SpiderBotLock! (2003) frames & carts (1997) Search question (1999) [ot] ascii values for lf and cr (2001) REPOST: How do _you_ back up your db? (2000) SSL with IIS 4.0 (1998) WebCat2 - [include] tags (1997) [WebDNA] Bug? [fileinfo..] You decide (2016) PIXO Support (1997) protect tag on NT IIS (1997) 4.51 Triggers (2003) # of real domains on 1 web server (1997) carriage returns in data (1997) Credit Card Number checking (1997) Search in 2 or more catalogs (1997)