News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
ebooks
Author Message
spencerhfuchs
Junior Member
**


Posts: 1
Group: Registered
Joined: Jun 2007
Status: Offline
Reputation: 0
Post: #1
ebooks

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?

06-27-2007 10:29 PM
Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #2
RE: ebooks

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

06-28-2007 06:11 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: