|
Maarek North
Registered User
Join date: 3 May 2006
Posts: 14
|
07-29-2008 14:32
So I need to pick your brains right quick...
I have a list where listlen(x) > 10 fields long... And I need to separate it out into groups or pages.
So first page would show the first 10 and the second page would show the next 10 and so on until the last page just shows what's left.
If you can just throw up some ideas on the logic I can probably script it out less you want to try or know of one already made.
Thanks.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
07-29-2008 16:10
Please clarify. Are you trying to put multiple pages of options in a DIALOG? If not, what DO you mean?
|
|
Maarek North
Registered User
Join date: 3 May 2006
Posts: 14
|
07-29-2008 16:23
I'm testing one I wrote up right quick but it doesn't need to be for a dialog exactly but could work for one with modifications for 10-12 elements depending on a back and next button... I was testing with just an llSetText to display the items instead of using a dialog but either works.
The idea was say you have pages in a book and only 10 lines could be displayed llSetText() on a page at a time. Each line is in your list... list lines = ["Hello\n", "Line 2\n", "Line 3\n"...]; to say 35 lines total...
Now you only want 10 elements in the list to display at a time and you want to be able to flip through the pages. So a next button will change integer page += 1; and back would -= 1;
|
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
07-29-2008 18:50
To divide everything into pages, all you really need to do is multiply your page number by the number of entries per page, and start counting up from there until you reach the maximum number per page, or the end of the list. You can also do bounds-checking by calculating how many pages there *could* be. Here's a (rather big) example script (it's in a GoogleCode SVN repository, hence the long URL!): http://code.google.com/p/sloodle/source/browse/trunk/sloodle/mod/set-1.0/sloodle_object_creator.lslIt's a script from an object which rezzes other objects. When the user touches it, a dialog is shown offering a list of inventory items. Search for a function called "sloodle_show_object_dialog", which is the bit which shows the object menu. In case you're wondering, the "llDialog" call is actually done by a different script, notified via link message.
|