Sorry, but I still need help!
 
Don't know why, but for some reason I cannot get this to work. What is really ticking me off is that I have done this before and I just can't find my snip. In fact, I used this method to show a list of authors in alpha order using the first letter of the last name as the header and skipping all letters with no authors - ie...
 
A
    John Anderson
    Jim Albert
    Frank Alpha
 
B
    John Bart
    Jim Burt
    Frank Bub
 
etc. etc.
 
I am doing a db call and searching Category and Title (in that order)... This is what I have so far using Win2k Witango 2000 (could this be an issue?)..
 
<@assign header value="">

<@rows array=test>

    <@if expr="<@col num=1>!=<@VAR header>">
        <@assign header value="<@col num=1>">
        <b><@VAR header></b><br>
    </@if>

    <@col num=2><br>

</@rows
 
Should be simple but I am just not seeing... I need a fresh set of eyes...


From: Alan Wolfe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 11, 2006 2:20 PM
To: [email protected]
Subject: Re: Witango-Talk: Creating an index

Sure, this uses h1's for categories and h3's for subjects just to keep things simple (:
 
<@assign local$header value="">
 
<@rows array=local$MyArray>
 
    <@if expr="<@col num=1>!=@@local$header">
        <@assign local$header value="<@col num=1>">
        <h1>@@local$header</h1>
    </@if>
 
    <h3><@col num=2></h3>
 
</@rows>


 
On 10/11/06, WebDude <[EMAIL PROTECTED]> wrote:
mmmm I have been trying to do this with an array...
 
I like your method, you have an actual snip?
 


From: Alan Wolfe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 11, 2006 2:03 PM
To: [email protected]
Subject: Re: Witango-Talk: Creating an index

 
I'm not sure if it's the most efficient way to do it but here's what i do (in pseudocode)
 
set local$header to "" (blank)
 
loop through the table and for each row:
{
 
  if column 1 is diferent than local$header
  {
    write out the header
    set local$header to column 1
  }
 
  write out column #2, indented
}
hope that helps!
Alan

 
On 10/11/06, WebDude <[EMAIL PROTECTED]> wrote:
 
Sorry if this seems so elementary...
 
I have a table that lists categories and subjects - ie...
 
category1    subject1
category1    subject2   
category1    subject3
category2    subject4
category2    subject5   
category2    subject6
category3    subject7
category3    subject8   
category3    subject9
 
How do I display...
 
category1   
    subject1
    subject2   
    subject3
 
category2   
    subject4
    subject5   
    subject6
 
category3   
    subject7
    subject8   
    subject9
 
 
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to