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 SoftwareHey!, 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]]1Fred2john[/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:
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 SoftwareHey!, 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]]1Fred2john[/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:
WebCat2b12 CGI Mac -- Problems propagating the cart through frames...still (1997)
ShowNext (1997)
your mail (2000)
GetWords (2004)
WebCat2b13MacPlugin - nested [xxx] contexts (1997)
shownext not showing next...still r2 (1997)
Protect vs Authenicate (1997)
[WebDNA] Webcat 6 - MacIntel - iTools (2008)
password authentication schemes (2003)
carriage returns in data (1997)
different show next (1997)
[WebDNA] possible bug? (db field named [width]) (2012)
# fields limited? (1997)
credit card (1997)
remotely creating and populating a stock inventory db - almost there! (1999)
Sorting (2000)
WebCat Mac OS X and Encrypt Help Need (2000)
Multiple Passwords (1997)
Dreamweaver noedit ??? (2005)
Shipcost formula (2004)