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:

Showif, Hideif reverse logic ? (1997) [WebDNA] Why doesn't this returnraw redirect to the new page? (2009) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) Show if time tags (1997) WebCat2 Append problem (B14Macacgi) (1997) Opinion: [input] should be called [output] ... (1997) plugin vs. acgi results (1998) [WebDNA] cron - curl to replace triggers.. (2009) Updating Prices db (still not working) (1999) WebCat on 10.0.4 - iTools 6.0 (2001) Major problem (1999) Interpret (2000) [append] problem (1997) Snake Bites (1997) Redirect frame targets (1998) how to get s repeatedly in and out of a form? (1999) no global [username] or [password] displayed ... (1997) Search for 20 finds 2000, 200 Why? (1997) [WebDNA] Mac Question (2018) Searching multiple fields from one form field (1997)