ID:963581
 
(See the best response by NNAAAAHH.)
Problem description:i have been coding an ingame forums using html and DM language but i am stuck i cant find a way to make pages here is the Code but no luck anyone can help me getting this done?

Make pages? As in make a list of post?

That's most easily done by making a list containing the post.

var/list/Post=new()
proc/Add_Post()
...//This is just an example of what to do when submiting a post
Post+=Posting
proc/get_pages()
var/pagenum=round(Post.len/[postperpage])//Find out how many pages of post you have
...//Use built-in list procs(.Copy) to sort out which post make it on which pages.
//The above would result in a error if you have 0 post in list/Post.
dude if you have a look at the source i got till there only thing i need to do is split the list of post list in to 10 posts per page (failed on that) other then that i got almost everything in control
In response to Lord Kakarot
Read the comments I posted within the code example, I explain you should use Post.Copy() in order to achieve the '10 post per page' deal. That was the entire purpose of my post.
for the runbtime error i can always check if the list has something or not but how can i determined the page list
In response to Lord Kakarot
Best response
mob/verb/View_Page()
var/pagenum=round(Post.len/[postperpage])//Find out how many pages of post you have
//This will result in a division by zero error if there is nothing in the list of post, easily fixed by a if() statement.
var/selectedpage=input("What page would you like to view") as num|null
if(selectedpage>pagenum||selectedpage<0){ alert("The page you're requesting doesn't exists"); return; }
var/list/TempListForPostOnPage=Post.Copy(1*num,10*num)//This will likely result in a error, being that I don't do any of the proper checks for you
src.DisplayList(TempListForPostOnPage)
let me ask one thing that 6th line {var/list/TempListForPostOnPage=Post.Copy(1*num,10*num)} 1*num was it suppose to be pagenum/selectedpage?
[EDIT]nm aperently i figured it out but by anychance are you good with javascript cause i cant figure out a way to embed javascriptinto DM thanks.[/EDIT]
[EDIT2]I was looking on javascript and java script just solved my problem apperently it just look like DM langauage (abit) so its easy to turn it into DM(thankyou java)[/EDIT2]
Have a gander at this - http://www.byond.com/developer/Kunark/ForumLib

It was developed a while ago, But you will still be able to grasp some concepts if you don't want to use a library.

I used to use it a long long time ago it's still great IMO.
In response to Lord Kakarot
I apologize, I meant to place 'slecetedpage' where I placed num there.
In response to A.T.H.K
A.T.H.K wrote:
Have a gander at this - http://www.byond.com/developer/Kunark/ForumLib

It was developed a while ago, But you will still be able to grasp some concepts if you don't want to use a library.

I used to use it a long long time ago it's still great IMO.

it is a great library but i was trying to make one myself
That doesn't mean you can read over certain parts an see how they have been handled right?
In response to A.T.H.K
A.T.H.K wrote:
That doesn't mean you can read over certain parts an see how they have been handled right?

I can read some of the parts but there are no instruction how things work and at my level i can understand some part of the library but anyways my problem is solved now (using Java and NNAAAAHH's provided way.