Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Message Threading algorithm ( like UT message threading
Message
 
 
To
27/01/1999 22:14:26
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00181162
Message ID:
00181255
Views:
13
>Hi~ all falks...
>I engaed in foxuser group in Korea. and nowadays I programmed for
>message threading on the Web.
>So I need a message threading Logic(algorithm).
>It's quit a difficult for me to solve out.
>
>Only using one table and processing all of messages and message level and so on....
>
>If possible, I want to get the UT's message threading logic.
>If you guys have a cleaner logic for this problem,
>please threading for me and Korean Foxpro Usergorup.
>Thanks.
>

I do not know if this is what Michel does, but I would have an ID field in the messages table that counts the level. When a new message is created, this ID is 1. For each reply created, take the number of the parent message, increment that value by 1, and store that number in the ID field.

In generating the HTML output, you would SCAN/ENDSCAN the result set of records, subtract the parent ID from the child ID minus 1 and multiply that by 3 [or whatever number you want to use] to determine how many spaces to indent each record [i.e., (ChildID - ParentID - 1) * 3 ]. You would use other field to determine when a new thread starts in order to start your new group.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform