Understanding variables

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 23787
interpreted = N
texte = I'm having difficulty understanding how to manipulate variables...Suppose I have the following in my template: [math]var1=0[/math] [math]var2=0[/math][search db=test.tpl&neskudata=[blank][math][var1][/math] [math][var2][math][founditems][showif [interpret][var[index]][/interpret]=0][/showif][hideif [interpret][added[index]][/interpret]=0][/hideif][/founditems][/search] Assuming 2 founditems:When page loads, var1=0, var2=0. GOOD. On the first pass through (clicking on add for first founditem) var1=1, var2=0. GOOD, as expected. On the third pass through (clicking on add for second founditem) var1 gets reset to 0, var2=1. BAD, VERY BAD.I don't get it. Why does var1 get reset to 0?????Test page may be found at http://www.tigernet.net/test.tplThanks. Associated Messages, from the most recent to the oldest:

    
  1. Re: Understanding variables (Will Starck 1999)
  2. Understanding variables (Will Starck 1999)
I'm having difficulty understanding how to manipulate variables...Suppose I have the following in my template: [math]var1=0[/math] [math]var2=0[/math][search db=test.tpl&neskudata=[blank][math][var1][/math] [math][var2][math][founditems][showif [interpret][var[index]][/interpret]=0][/showif][hideif [interpret][added[index]][/interpret]=0][/hideif][/founditems][/search] Assuming 2 founditems:When page loads, var1=0, var2=0. GOOD. On the first pass through (clicking on add for first founditem) var1=1, var2=0. GOOD, as expected. On the third pass through (clicking on add for second founditem) var1 gets reset to 0, var2=1. BAD, VERY BAD.I don't get it. Why does var1 get reset to 0?????Test page may be found at http://www.tigernet.net/test.tplThanks. Will Starck

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:

linetiems in thankyou.tpl (1997) Calculating multiple shipping... (1997) webcat- multiple selection in input field (1997) Summing fields (1997) WriteFile and returns... (2000) email program problem (1998) docs for WebCatalog2 (1997) Text limits in NT version? (1997) Snake Bites (1997) Moment of Thanks (1997) Oops, my mistake - (was Bad suffix error) (1997) Re[2]: ftp access on Macos X (2000) WebDNA 5.x & iTools 7 & Apache 2 (2003) Question About XML Style Syntax (2000) WebCat2: multiple currency support (1997) RE: Include (1998) Generating unique SKU from [cart] - Still Stumped... (1997) OT: need bad code (2005) Thanks for tips, more quest (1997) Charting records by state (2000)