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:

Sorting Orders (1997) Great product and great job ! (1997) [AppendFile] problem (WebCat2b13 Mac .acgi) (1997) format crash! (1997) Running 2 two WebCatalog.acgi's (1996) Multiple prices (1997) math on date? (1997) WebDNA Intranet Edition public demo (2002) Status of variable hierarchy changes? (2000) Accessing SQL server from OSX (2001) [WebDNA] autonumber duplication, time stamp issue & locking up (2010) [WebDNA] TCPConnect Problem (2010) databases locked/unservable? (2003) oops private message leaked into talk list (1997) [movefile] (1999) adding time (2003) 'page impression' techniques for banner ads (1999) Cancel Subscription (1996) select multiple 2 more cents (1997) WebCat2 - Getting to the browser's username/password data (1997)