TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Nicolas Baker
from: Peter Leschev
date: 1996-12-13 23:16:18
subject: Text viewer

-=> Quoting Nicolas Baker to All <=-
Hi!

 NB> Recently I have been trying to code a program that displays a file
 NB> (with scrolling), but while I think this should be a simple task, it is
 NB> presenting some major problems. Does anyone have some basic ideas for
 NB> how to implement this?

        Well in order to scroll the file, you need to store it in memory...
Firstly, you have to decide whether or not you want text wrapping.
        Work out how many lines the file has, then allocate a pointer for each
line. As you're loading the file in, work out how long the line is and allocate
that much memory. It's much easier if you don't have text wrapping...
        To display, you have pointer to the line which is at the top of the
screen, then just go through printing out each line to screen....
        That's basically what I would do....

        Hope this helps...

        Peter

... Coming soon: Netware for the Nintendo!
--- FMail/386 1.22+
* Origin: Lateline BBS, Sydney; +61-2-9579-6564; 24 hours; 33.6k (3:712/841)
SEEN-BY: 633/267 270
@PATH: 712/841 624 515 711/808 50/99 635/728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.