[thelist] asp LOGIC QUESTION

Ian Anderson ian at zstudio.co.uk
Fri Apr 21 14:53:00 CDT 2006

Matt Warden wrote:

> Which is exactly the output above with the category output suppressed
> for every record but when the category changes. This is what my
> pseudocode is handling. (This is also why it is imperative to order by
> category first.)

Oh... I think I get it this time. Would that really work? When I have 
finished sobbing I may have to come and give you a big slobbery kiss. 
That is quite clever, in the way that a marmoset is probably not.

In addition to me being quite thick, I think I missed the point because 
you weren't setting the value of catname in the loop

Would this then give the output desired assuming the recordset is sorted 
on catname:

var currentcat = ''
loop until end of recordset
     if currentcat != recordset.catname then
         // do whatever you need to do for each category
         write recordset.catname + "<br>"
         currentcat = recordset.catname
     end if
     // do whatever you need to do for each thing
     write "- " + recordset.thing
end loop

It has to write two lines out for an iteration where the catname changes 
but only one the rest of the time


zStudio - Web development and accessibility
- http://zStudio.co.uk
Snippetz.net - Your personal, private code library
- http://snippetz.net

More information about the thelist mailing list