Re: [WebDNA] Now: Listfields does not work with tables - Was: [OT]

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 106971
interpreted = N
texte = Brian Fries wrote: > Here's one to spark your imagination, Donovan… > > I've been known to have code in one place that decides whether it's using a db or a table: > > [text]tDBPath=[if …][then]db=my.db[/then][else]table=mytable[/else][/if][/text] > > … then later use that in a search: > > [search [tDBPath]&wofielddata=…] > > … It would be nice to be able to then use listfields: > > [listfields [tDBPath]] > [fieldname]=[interpret][[fieldname]][/interpret]
> [/listfields] > > > Sure there are workarounds, but every WebDNA tag that takes a "db" parameter should alternatively take a "table" parameter so consistent coding can be used / reused. > > Brian Fries > BrainScan Software Hey!, I've seen that style of coding before.. somewhere? ;-) I see a point to it, don't get me wrong. I think a "fix" like this would likely come down to priorities and policy however. "It's a workable idea, but is it really needed right now?" sort of thing. Note, WSC would have to change [listdatabases...] as well. Anyway, as Brian mentioned, even with his complex style of coding, a global listfiles type of feature could be accommodated with some key naming conventions set.: ---------------- [text]tf_mytable=id,name[/text] [table name=tb_test&fields=[tf_mytable]] 1Fred 2john [/table] [text]tDBPath=[if …][then]db=my.db[/then][else]table=mytable[/else][/if][/text] [if "[tDBPath]"^".db"] [then] [listfields [tDBPath]] [fieldname]=[interpret][[fieldname]][/interpret]
[/listfields] [/then] [else] [listwords words=[interpret][tf_[tDBPath]][/interpret]] [word]
[/listwords] [/else] [/if] ---------------- You could shorten the use of this feature up with your own function [db_listfields ..] Note, I don't officially work for WSC right at this time, so these are just my *developer* opinions. Donovan -- Donovan Brooke **[Square Bracket Utopia]** Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Now: Listfields does not work with tables - Was: [OT] MySQL Users (Kenneth Grome 2011)
  2. Re: [WebDNA] Now: Listfields does not work with tables - Was: [OT] (Donovan Brooke 2011)
  3. Re: [WebDNA] Now: Listfields does not work with tables - Was: [OT] (Donovan Brooke 2011)
  4. Re: [WebDNA] Now: Listfields does not work with tables - Was: [OT] MySQL Users (Brian Fries 2011)
  5. Re: [WebDNA] Now: Listfields does not work with tables - Was: [OT] (Donovan Brooke 2011)
  6. Re: [WebDNA] Now: Listfields does not work with tables - Was: [OT] MySQL Users (Govinda 2011)
  7. [WebDNA] Now: Listfields does not work with tables - Was: [OT] MySQL Users (Donovan Brooke 2011)
Brian Fries wrote: > Here's one to spark your imagination, Donovan… > > I've been known to have code in one place that decides whether it's using a db or a table: > > [text]tDBPath=[if …][then]db=my.db[/then][else]table=mytable[/else][/if][/text] > > … then later use that in a search: > > [search [tDBPath]&wofielddata=…] > > … It would be nice to be able to then use listfields: > > [listfields [tDBPath]] > [fieldname]=[interpret][[fieldname]][/interpret]
> [/listfields] > > > Sure there are workarounds, but every WebDNA tag that takes a "db" parameter should alternatively take a "table" parameter so consistent coding can be used / reused. > > Brian Fries > BrainScan Software Hey!, I've seen that style of coding before.. somewhere? ;-) I see a point to it, don't get me wrong. I think a "fix" like this would likely come down to priorities and policy however. "It's a workable idea, but is it really needed right now?" sort of thing. Note, WSC would have to change [listdatabases...] as well. Anyway, as Brian mentioned, even with his complex style of coding, a global listfiles type of feature could be accommodated with some key naming conventions set.: ---------------- [text]tf_mytable=id,name[/text] [table name=tb_test&fields=[tf_mytable]] 1Fred 2john [/table] [text]tDBPath=[if …][then]db=my.db[/then][else]table=mytable[/else][/if][/text] [if "[tDBPath]"^".db"] [then] [listfields [tDBPath]] [fieldname]=[interpret][[fieldname]][/interpret]
[/listfields] [/then] [else] [listwords words=[interpret][tf_[tDBPath]][/interpret]] [word]
[/listwords] [/else] [/if] ---------------- You could shorten the use of this feature up with your own function [db_listfields ..] Note, I don't officially work for WSC right at this time, so these are just my *developer* opinions. Donovan -- Donovan Brooke **[Square Bracket Utopia]** Donovan Brooke

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:

New global preference ... ??? (2000) Large File Uploads Impact WebDNA Performance (IIS) (2003) Questions on Mac WC 3.0.5b13 (2000) Tab Charactor (1997) searching multiple databases in single search (1997) emailer setup (1997) [OT] Getting a domain listening on port 443 and port80? (2003) Re:2nd WebCatalog2 Feature Request (1996) Database Options (1997) Projects & Contractors (1997) limitation found on group searching (1997) [showif] based on data from [tcpconnect][tcpsend]? (2000) [WebDNA] Clean URLS job - will pay (2010) [format] problem (2001) [OT] Who's got a cool link (2002) Weird Math (2000) copyfile (2003) [ConvertChars] problem (1997) Include files (1998) Multi Actions (1999)