Re: old problem

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 39950
interpreted = N
texte = I've taken a look at your original post. To restate your problem, as I understand it:1) You have a folder called orders that contains numerous files 2) You have a database file in folder orders called filelist.db, which includes the field filenames that specifies the name of a file that should be in the order folder 3) If a file specified in the filelist.db is not in the orders folder, you want to delete the record from the filelist.dbHere's how I would approach this problem...First, I'd use a text variable list of existing file names rather than creating a temporary database, as you only need a simple containment test, do not need to store multiple fields for these files, and do not need to sort the list.Second, I'd build a text variable list of records to be deleted. You never want to delete records within a founditems block that has found more than one item, as it will cause WebCat's list of found items to get out of sync with what's really in the database.Third, I'd go through the list of records to be deleted, and delete them one at a time.The code: [!] Build list of files in folder orders [/!] [text]tFiles=|[/text] [listfiles orders] [text]tFiles=[tFiles][filename]|[/text] [/listfiles][!] Build list of files listed in orders/filelist.db that aren't in the orders folder [/!] [text]tDeleteMe=|[/text] [search db=orders/filelist.db&neFILENAMESdatarq=find_all&rank=off] [founditems] [hideif [url][tFiles][/url]^[url]|[filenames]|[/url]] [text]tDeleteMe=[tDeleteMe][filenames]|[/text] [/hideif] [/founditems] [/search][!]Delete all the DB records listed in tDeleteMe[/!] [listwords words=[url][tDeleteMe][/url]&delimiters=|] [delete db=orders/filelist.db&eqFILENAMESdatarq=[url][word][/url]] [/listwords] At 10:13 AM +0000 11/7/2001, Laeg Ent. wrote: >Did this code work for you? Its not working for me at >all. I've held the code on its own in a file, and >tested it just typing the URL into a browser and no >joy. No files are deleted(that should be deleted). >This really has me baffled as all different approaches >to date have not worked. > > > --- Rob Marquardt wrote: > on >11/6/01 5:24 am, Laeg Ent. at >> laeg_enterprises@yahoo.co.uk so noted... >> >> > Perhaps my dependencies are wrong. This should >> work >> > assuming that >> > >> > a)orders/filelist.db has a .hdr with the word >> > filenames in it >> >> Yes. >> >> > b)does case matter with the word filenames in >> lines >> > like >> > >> > (i)[search >> > db=orders/filelist.db&neFilenamesData=[blank]] >> > (ii)[delete >> > >> db=orders/filelist.db&eqFILENAMESdata=[text]delFile >> > > Nope. : ) > >------------------------------------------------------------- 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: [WebDNA] Old Problem, the exclamation point (Terry Wilson 2014)
  2. Re: [WebDNA] Old Problem, the exclamation point (Terry Wilson 2014)
  3. Re: [WebDNA] Old Problem, the exclamation point (Donovan Brooke 2014)
  4. Re: [WebDNA] Old Problem, the exclamation point (Terry Wilson 2014)
  5. Re: [WebDNA] Old Problem, the exclamation point (Steve Braun 2014)
  6. Re: [WebDNA] Old Problem, the exclamation point (Terry Wilson 2014)
  7. Re: [WebDNA] Old Problem, the exclamation point (Donovan Brooke 2014)
  8. Re: [WebDNA] Old Problem, the exclamation point (Steve Braun 2014)
  9. Re: [WebDNA] Old Problem, the exclamation point (Tom Duke 2014)
  10. [WebDNA] Old Problem, the exclamation point (Steve Braun 2014)
  11. Re: old problem (Brian Fries 2001)
  12. Re: old problem (Rob Marquardt 2001)
  13. Re: old problem (Laeg Ent. 2001)
  14. Re: old problem (Laeg Ent. 2001)
  15. Re: old problem (Rob Marquardt 2001)
  16. Re: old problem (Laeg Ent. 2001)
  17. Re: old problem (Rob Marquardt 2001)
  18. old problem (Laeg Ent. 2001)
  19. Re: OLD PROBLEM (bob 1997)
  20. OLD PROBLEM (natasha 1997)
I've taken a look at your original post. To restate your problem, as I understand it:1) You have a folder called orders that contains numerous files 2) You have a database file in folder orders called filelist.db, which includes the field filenames that specifies the name of a file that should be in the order folder 3) If a file specified in the filelist.db is not in the orders folder, you want to delete the record from the filelist.dbHere's how I would approach this problem...First, I'd use a text variable list of existing file names rather than creating a temporary database, as you only need a simple containment test, do not need to store multiple fields for these files, and do not need to sort the list.Second, I'd build a text variable list of records to be deleted. You never want to delete records within a founditems block that has found more than one item, as it will cause WebCat's list of found items to get out of sync with what's really in the database.Third, I'd go through the list of records to be deleted, and delete them one at a time.The code: [!] Build list of files in folder orders [/!] [text]tFiles=|[/text] [listfiles orders] [text]tFiles=[tFiles][filename]|[/text] [/listfiles][!] Build list of files listed in orders/filelist.db that aren't in the orders folder [/!] [text]tDeleteMe=|[/text] [search db=orders/filelist.db&neFILENAMESdatarq=find_all&rank=off] [founditems] [hideif [url][tFiles][/url]^[url]|[filenames]|[/url]] [text]tDeleteMe=[tDeleteMe][filenames]|[/text] [/hideif] [/founditems] [/search][!]Delete all the DB records listed in tDeleteMe[/!] [listwords words=[url][tDeleteMe][/url]&delimiters=|] [delete db=orders/filelist.db&eqFILENAMESdatarq=[url][word][/url]] [/listwords] At 10:13 AM +0000 11/7/2001, Laeg Ent. wrote: >Did this code work for you? Its not working for me at >all. I've held the code on its own in a file, and >tested it just typing the URL into a browser and no >joy. No files are deleted(that should be deleted). >This really has me baffled as all different approaches >to date have not worked. > > > --- Rob Marquardt wrote: > on >11/6/01 5:24 am, Laeg Ent. at >> laeg_enterprises@yahoo.co.uk so noted... >> >> > Perhaps my dependencies are wrong. This should >> work >> > assuming that >> > >> > a)orders/filelist.db has a .hdr with the word >> > filenames in it >> >> Yes. >> >> > b)does case matter with the word filenames in >> lines >> > like >> > >> > (i)[search >> > db=orders/filelist.db&neFilenamesData=[blank]] >> > (ii)[delete >> > >> db=orders/filelist.db&eqFILENAMESdata=[text]delFile >> > > Nope. : ) > >------------------------------------------------------------- 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/ Brian Fries

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:

WebCat2 Append problem (B14Macacgi) (1997) Fun with dates (1997) Re:no template caching (1997) Re2: Calculating multiple shipping... (1997) WebCatalog.acgi quitting with error Type 2 (1998) db not being written to disk (2003) PCS Frames-Default page is solution! (1997) Search multiple fields (1997) WCS Newbie question (1997) OT-JS why it does not run on Mac (2001) Reversed words (1997) WC1.6 to WC2 date formatting (1997) how to set a new cart number periodically (1999) Caching [include] files ... (1997) Authorize.net, SIM, tcpconnect and applescript (2003) Cookies (1998) Beta 18 (1997) [SearchString] usage (1997) Virtual hosting and webcatNT (1997) Multi-processor Mac info ... (1997)