Murga-Projects Forums

Full Version: ebooks
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am a co-author on an open source multi-platform ebook reader. And I'm new to the whole writing code scene. Murgalua is the one that has made the most sense yet.

We have made the read_in read chunk 10k for the purpose of speed, but by doing this we have made it more difficult to write the previous_set function.


Quote:
function previous_set()
if fetch == nil then
fetch = 1
else
fetch = fetch - 1
end
print(fetch)
block = read_in(book_file)
local jo = do_justify(cur_pages[page_now - 1] .. block, 35)
local num_lines, num_pages, lines, bbp, p = pages(jo)
cur_pages = p
page_now = 0
total_pages =#p
end



When you go back tho it goes into negatives on the pages(shows a blank page after it has ran the buffer out) versus pulls the previous 10k chunk.

Is there any easier way to do this?

Hi

I would have though it was a question of changing :

Code:
if fetch == nil then


For :

Code:
if fetch == nil or fetch < 1 then


Unless I am missing something ?

Cheers
JohnM

Reference URL's