Re: [WebDNA] Dynamic vertical columns

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 100627
interpreted = N
texte = Sorry to be coming to this a little late, but I did this a few years ago, with very simple and straightforward code using only showif and ceil: http://3dcenter.us/thankyou.html?ind=t [search ...stuff...] (header stuff in the first few rows)
[founditems] [showif [index]=[math]ceil([numfound]/3)[/math]]
[first] [last][state]
[/showif] [showif [index]=[math]ceil(2*[numfound]/3)[/math]]
[/showif] [/founditems]
[/search] Terry >Well thanks to everyone for their thoughts and to Toby who brought >modulus % to my attention, this flicked the switch for me, after 10 >years at WebDNA I had never used it or even knew it existed. > >Here is my answer, it works for 3 columns and if you fiddle with the >switches you will make it work for other numbers of columns. > >[Search db=^data/species.db&neSACTIVEdatarq=ALL&asSCOMMONNAMEsort=1] >NumFound = [NumFound]
>remainder=[Math]remainder=[NumFound]%3[/Math]
>percolumn=[Math]percolumns=floor([NumFound]/3)[/Math]
>totalpercolumn=[Math]totalpercolumn=[Switch value=[remainder]][Case >value=2]1[/Case][Case value=1]1[/Case][Default]0[/Default][/Switch] >+[percolumns][/Math]
> > > > > > > > > > > > > > > > >
COL 01COL 02COL 03
[FoundItems][ShowIf >[Index]<[math][totalpercolumn]+1[/math]][index] - >[scommonname]
[/ShowIf][/FoundItems]
[FoundItems][If >([Index]>[Math][totalPERCOLUMN][/Math])&([Index]<[math][NumFound]-[totalPERCOLUMN]+[Switch >value=[remainder]][Case value=2]2[/Case][Case value=1]3[/Case][Case >value=0]1[/Case][Default]0[/Default][/Switch][/math])][then][index] >- [scommonname]
[/Then][/If][/FoundItems]
[FoundItems][ShowIf >[Index]>[Math][NumFound]-[totalpercolumn]+[Switch >value=[remainder]][Case value=2]2[/Case][Case >value=1]2[/Case][Default]0[/Default][/Switch][/Math]][index] - >[SCOMMONNAME]
[/ShowIf][/FoundItems]
> >[/Search] >--------------------------------------------------------- >This message is sent to you because you are subscribed to >the mailing list . >To unsubscribe, E-mail to: -- Terry Wilson | terry@terryfic.com | http://terryfic.com http://WhosComing.com - a simplified, affordable online reservation system http://TightJacket.com -- stylish protection for your laptop -------------------------------------------------------------------------- Attitude is the only difference between ordeal and adventure. Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Dynamic vertical columns ("PLANET DJ (Chris W.)" 2008)
  2. Re: [WebDNA] Dynamic vertical columns (Stuart Tremain 2008)
  3. Re: [WebDNA] Dynamic vertical columns ("PLANET DJ (Chris W.)" 2008)
  4. Re: [WebDNA] Dynamic vertical columns (Stuart Tremain 2008)
  5. re: [WebDNA] Dynamic vertical columns ("PLANET DJ (Chris W.)" 2008)
  6. Re: [WebDNA] Dynamic vertical columns (Terry Wilson 2008)
  7. Re: [WebDNA] Dynamic vertical columns (Patrick McCormick 2008)
  8. Re: [WebDNA] Dynamic vertical columns (Stuart Tremain 2008)
  9. Re: [WebDNA] Dynamic vertical columns (Terry Wilson 2008)
  10. Re: [WebDNA] Dynamic vertical columns (Terry Wilson 2008)
  11. Re: [WebDNA] Dynamic vertical columns (Stuart Tremain 2008)
  12. Re: [WebDNA] Dynamic vertical columns (Stuart Tremain 2008)
  13. Re: [WebDNA] Dynamic vertical columns (Stuart Tremain 2008)
  14. Re: [WebDNA] Dynamic vertical columns (Stuart Tremain 2008)
  15. Re: [WebDNA] Dynamic vertical columns (Toby Cox 2008)
  16. Re: [WebDNA] Dynamic vertical columns (Paul Willis 2008)
  17. Re: [WebDNA] Dynamic vertical columns (Palle Bo Nielsen 2008)
  18. Re: [WebDNA] Dynamic vertical columns (Stuart Tremain 2008)
  19. Re: [WebDNA] Dynamic vertical columns (Palle Bo Nielsen 2008)
  20. Re: [WebDNA] Dynamic vertical columns (Stuart Tremain 2008)
  21. Re: [WebDNA] Dynamic vertical columns ("Dan Strong" 2008)
  22. RE: [WebDNA] Dynamic vertical columns ("Will Starck" 2008)
  23. [WebDNA] Dynamic vertical columns (Stuart Tremain 2008)
Sorry to be coming to this a little late, but I did this a few years ago, with very simple and straightforward code using only showif and ceil: http://3dcenter.us/thankyou.html?ind=t [search ...stuff...] (header stuff in the first few rows)
[founditems] [showif [index]=[math]ceil([numfound]/3)[/math]]
[first] [last][state]
[/showif] [showif [index]=[math]ceil(2*[numfound]/3)[/math]]
[/showif] [/founditems]
[/search] Terry >Well thanks to everyone for their thoughts and to Toby who brought >modulus % to my attention, this flicked the switch for me, after 10 >years at WebDNA I had never used it or even knew it existed. > >Here is my answer, it works for 3 columns and if you fiddle with the >switches you will make it work for other numbers of columns. > >[Search db=^data/species.db&neSACTIVEdatarq=ALL&asSCOMMONNAMEsort=1] >NumFound = [NumFound]
>remainder=[math]remainder=[NumFound]%3[/Math]
>percolumn=[math]percolumns=floor([NumFound]/3)[/Math]
>totalpercolumn=[math]totalpercolumn=[Switch value=[remainder]][Case >value=2]1[/Case][Case value=1]1[/Case][Default]0[/Default][/Switch] >+[percolumns][/Math]
> > > > > > > > > > > > > > > > >
COL 01COL 02COL 03
[founditems][ShowIf >[Index]<[math][totalpercolumn]+1[/math]][index] - >[scommonname]
[/ShowIf][/FoundItems]
[founditems][If >([Index]>[math][totalPERCOLUMN][/Math])&([Index]<[math][NumFound]-[totalPERCOLUMN]+[Switch >value=[remainder]][Case value=2]2[/Case][Case value=1]3[/Case][Case >value=0]1[/Case][Default]0[/Default][/Switch][/math])][then][index] >- [scommonname]
[/Then][/If][/FoundItems]
[founditems][ShowIf >[Index]>[math][NumFound]-[totalpercolumn]+[Switch >value=[remainder]][Case value=2]2[/Case][Case >value=1]2[/Case][Default]0[/Default][/Switch][/Math]][index] - >[SCOMMONNAME]
[/ShowIf][/FoundItems]
> >[/Search] >--------------------------------------------------------- >This message is sent to you because you are subscribed to >the mailing list . >To unsubscribe, E-mail to: -- Terry Wilson | terry@terryfic.com | http://terryfic.com http://WhosComing.com - a simplified, affordable online reservation system http://TightJacket.com -- stylish protection for your laptop -------------------------------------------------------------------------- Attitude is the only difference between ordeal and adventure. Terry Wilson

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:

WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) Make sure I understand this??? (1997) Macauth: Dates and No Scripting... (1997) using showpage and showcart commands (1996) Why did this copyfile stop working? (2004) Dreamweaver noedit ??? (2005) Trouble with formula.db + more explanation (1997) Whats up with emailer? (1998) graphic to appear automatically... (2000) WebTen? (1997) Show shoppingcart after remove last item (1997) What port is Email on ? (2000) Happy Halloween - Check out the pumpkin (2002) [WebDNA] WebDNA tags not getting interpreted directory listing (2014) Bug Report, maybe (1997) HTTP header line is too long? (1997) Changing price for a SLU based on options (size, etc.) (1997) This list needs a digest: rant, rave... (1997) WC2b15 File Corruption (1997) RE: PIXO support (1997)