Re: how to add from an Include file command

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 62898
interpreted = N
texte = I saw no logical error in what you propose. There are some syntax issues and practical considerations. For example, why are you using a writefile to store the var2? If that page is loaded by someone else, the file will be overwritten. There also could be some file caching at work to save on the disk reads. On Sep 1, 2005, at 12:32 AM, sbraun wrote: > Hello, > > I need to total a list of numbers read from a database. > I think that I'm having a problem using [writefile] and [include] tags > > 1) After a [search] and [founditems] I get the value in DURATION > which is in %H:%M format, so I convert it to seconds.... > [text]var1=[math]{[DURATION]}[/math][/text] I would have to check the docs for this syntax. Others here may know off the top of their heads if this will work. You can confirm by reviewing the results using: [text show=T]var1=[math]{[DURATION]}[/math][/text]
If that gives the number you expect, you are all set. > > 2) then I add the new value, var1 to the amount read from the file > named: atextfile.inc (which is 0 the first time through) > [text][math]var2=[include file=atextfile.inc]+[var1][/math][/text] Try: [text]var2=[math][include file=atextfile.inc]+[var1][/math][/text] or if you can do not need the writefile and/or want to review the value as the script calculates it: [text]var2=[math][var2]+[var1][/math][/text]
> > 3) then I write var2 back to the same text file: atextfile.inc > [writeFile atextfile.inc][var2][/writeFile] > > I end with [/founditems], so that it will go back and find the next > value in DURATION > > each time it executes step 2, the number from the include file > command is reset to zero. > I can't seem to get it to write a value, then read it back to add it > each time. > > Where is my error? > > Thanks all, > sfb > > > ------------------------------------------------------------- > 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:

    
  1. Re: how to add from an Include file command ( Gary Krockover 2005)
  2. Re: how to add from an Include file command ( William DeVaul 2005)
  3. how to add from an Include file command ( sbraun 2005)
I saw no logical error in what you propose. There are some syntax issues and practical considerations. For example, why are you using a writefile to store the var2? If that page is loaded by someone else, the file will be overwritten. There also could be some file caching at work to save on the disk reads. On Sep 1, 2005, at 12:32 AM, sbraun wrote: > Hello, > > I need to total a list of numbers read from a database. > I think that I'm having a problem using [writefile] and [include] tags > > 1) After a [search] and [founditems] I get the value in DURATION > which is in %H:%M format, so I convert it to seconds.... > [text]var1=[math]{[DURATION]}[/math][/text] I would have to check the docs for this syntax. Others here may know off the top of their heads if this will work. You can confirm by reviewing the results using: [text show=T]var1=[math]{[DURATION]}[/math][/text]
If that gives the number you expect, you are all set. > > 2) then I add the new value, var1 to the amount read from the file > named: atextfile.inc (which is 0 the first time through) > [text][math]var2=[include file=atextfile.inc]+[var1][/math][/text] Try: [text]var2=[math][include file=atextfile.inc]+[var1][/math][/text] or if you can do not need the writefile and/or want to review the value as the script calculates it: [text]var2=[math][var2]+[var1][/math][/text]
> > 3) then I write var2 back to the same text file: atextfile.inc > [writeFile atextfile.inc][var2][/writeFile] > > I end with [/founditems], so that it will go back and find the next > value in DURATION > > each time it executes step 2, the number from the include file > command is reset to zero. > I can't seem to get it to write a value, then read it back to add it > each time. > > Where is my error? > > Thanks all, > sfb > > > ------------------------------------------------------------- > 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/ William DeVaul

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:

ThisURL (2000) WebCat2 - storing unformatted date data? (1997) 5.0 feature request: Sort for ListWords (2001) Re1000001: Setting up shop (1997) WebCommerce: Folder organization ? (1997) japanese characters (1997) PhotoMill -> PhotoMaster (1997) Showing Results Alphabetically in Columns (top to bottom) (2002) security (1997) [format 40s]text[/format] doesn't work (1997) WC2b12: Yes, Formulas.db is for real (1997) Help! WebCat2 bug (1997) Inventory Debit Procedure (1998) Associative lookup style? + bit more (1997) About the hyphen in searches (2003) What file? (1997) Ok here is a question? (1997) canEmail? (1998) Help with update to 2.11 (1998) Sorting problem (2002)