f



Textwrap Trouble!

Hi,

I wonder whether anyone can give me some helpful ideas (or point me to some
actual 'living' examples) for solving the following problem:

I am dealing with a large quantity of text which will be read from a file,
formatted by my program, and wrapped to fit the present width of the window
in which it will be displayed. It is to be presented as continuous document.

Normally, I would program my code to read ALL the text I intend to display
into a designated "text area", then process the text area to generate a
"textwrap index". This index would divide the text buffer into correctly
sized portions for each line in the window display. Thus each entry in the
index points to the appropriate place to start "Font_Paint"ing the text for
the given line in the redraw sequence.

In this case, however, the portion of text is excessively large. It is not
possible to load it all at once and create a text wrap index. It will be
necessary to process a particular portion of the text, depending on the
position of the vertical scrollbar. The difficulty is in relating the
position of the vertical scrollbar to the position in the text file.

  ## 1 ## Since the width of the window and the font size of the text are
variables which directly affect the textwrap index, it is difficult to
conceive of a hard-coded index (produced by running ALL the text I wish to
display through the load and format procedure, wrapping for width x and
saving the index values) that can be pre-loaded, which would provide the
necessary information to enable the program to relate the lines of the
window to the appropriate position in the textfile.

  ## 2 ## Since the volume of data is large, flying through the text in the
file in an attempt to generate a quick textwrap index every time the width
of the window is adjusted or the font size is changed is not a practical
solution.

Without some precalculated index spanning from the top of the text to the
bottom that relates the text data to be displayed to a series of lines no
wider than the text window, I am not sure how my program is going to know
which bit of text to display when -- or even how large to make the window
(vertically).

I hope I have adequately explained this (!). If anyone has tackled this
problem before (perhaps in a text editor) or has some notion of how to solve
it, I'd appreciate your thoughts. I have not yet come up with a "neat"
solution. (The program is in BASIC, incidentally)

Cheers,

W.Simpson


0
7/4/2003 1:05:09 PM
comp.sys.acorn.programmer 2499 articles. 0 followers. Post Follow

0 Replies
277 Views

Similar Articles

[PageSpeed] 42

Reply:

Similar Artilces:

Programmers, Programmers, Programmers, ...
As Steve Balmer correctly stated, while making his monkey dance, it is applications and hence programmers that make a platform. The fact though is that if you want to do professional programming, then Linux is the platform for you. I know that this statement will get the heckels up on a lot of trolls in C.O.L.A, but I have a recent experience that proves this. I am currently working for a Windows only house producing a system that receives and transmits around 1000 telegrams per second in each direction on a UDP socket, translates them into a different format and creates a log entry for each ...

More space programmes in trouble...
http://news.bbc.co.uk/1/hi/sci/tech/4435576.stm Anyone know what's used in this one? ...

Acorn Electron Troubles
Hi all, any Electron guru's here? I have a totally DEAD electron that I would like to repair. It has an Issue 6 mainboard. On switching on, nothing happens. The mains PSU is working fine, the internal PSU is also working as it is putting out +5v, 0V, -5V. The Caps lock LED does not illuminate. There is also no display or startup BEEP. Comparing this board to another of my Issue 6's the IC's 4,5,6,7,11,12 (memory I think) and IC2 ( OS ? ) get's red hot! Wereas my "working" issue 6, only the CPU (IC 3) and memory get "slightly warm which I think is usual. Any idea's? I dont want to leave it on to long trying to blindly diagnose with temperatures like that going on. Regards, Rich. In message <ceb55dc1.0407162248.1270488d@posting.google.com> uzi@ukgateway.net (Rich) wrote: > On switching on, nothing happens. The mains PSU is working fine, the > internal PSU is also working as it is putting out +5v, 0V, -5V. > > The Caps lock LED does not illuminate. There is also no display or > startup BEEP. > > Comparing this board to another of my Issue 6's the IC's 4,5,6,7,11,12 > (memory I think) and IC2 ( OS ? ) get's red hot! > > Wereas my "working" issue 6, only the CPU (IC 3) and memory get > "slightly warm which I think is usual. > > Any idea's? I dont want to leave it on to long trying to blindly > diagnose with temperatures like that going on. If...

RISCOS/Acorn Eprom programmer
Hi, Does anyone know where I can get an EPROM programmer for a RISCOS 3.11 A5000? Must blow up to 256Kbit bog standard ST EPROMs. Cheers all, - Chris. In message <3fdd0a07$0$10357$fa0fcedb@lovejoy.zen.co.uk> "Chris Smith" <chris@FARPinfinitemonkeys.org.uk> wrote: > Hi, > > Does anyone know where I can get an EPROM programmer for a RISCOS 3.11 > A5000? Must blow up to 256Kbit bog standard ST EPROMs. Did you try IFEL's web site ? I think they were selling one not so long ago <http://users.argonet.co.uk/ifel> (or there abouts) -- J�r�me Mathevet On Mon, 15 Dec 2003 01:10:31 -0000, "Chris Smith" <chris@FARPinfinitemonkeys.org.uk> wrote: >Hi, > >Does anyone know where I can get an EPROM programmer for a RISCOS 3.11 >A5000? Must blow up to 256Kbit bog standard ST EPROMs. What'd you be willing to pay ? John Kortink -- Email : kortink@inter.nl.net Homepage : http://www.inter.nl.net/users/J.Kortink ViewFinder, the high performance graphics card for RISC PC's : visit http://www.windfall.nl for more details and pricing. ...

trouble to insert into SYS.XMLType
hi all this is code to insert into SYS.XMLType column (in *.pc file): EXEC SQL PREPARE InsertObj FROM :oraSqlstmt; oraERR_CHECK(PersistentStore,CreateObject,uFalse); EXEC SQL DESCRIBE BIND VARIABLES FOR InsertObj INTO _insertDesc; oraERR_CHECK(PersistentStore,CreateObject,uFalse); _insertDesc->N = _insertDesc->F; .. .. .. qdes->L[*col] = len; qdes->V[*col] = (char *) _dbBuffer; qdes->T[*col] = psOracleExternalTypeLONGVARCHAR; // Oralce LONG VARCHAR (94) qdes->I[*col] = & _dbIndicator; .. .. EXEC SQL EXECUTE InsertObj USING DESCRIPTOR _insertDesc; but i have error ORA-01461 can bind LONG value only for insert into a LONG column whats wrong? may be for SYS.XMLType its need to use other type, but what type? P.S. sorry for my english ...

trouble to insert into SYS.XMLType
hi all this is code to insert into SYS.XMLType column (in *.pc file): EXEC SQL PREPARE InsertObj FROM :oraSqlstmt; oraERR_CHECK(PersistentStore,CreateObject,uFalse); EXEC SQL DESCRIBE BIND VARIABLES FOR InsertObj INTO _insertDesc; oraERR_CHECK(PersistentStore,CreateObject,uFalse); _insertDesc->N = _insertDesc->F; .. .. .. qdes->L[*col] = len; qdes->V[*col] = (char *) _dbBuffer; qdes->T[*col] = psOracleExternalTypeLONGVARCHAR; // Oralce LONG VARCHAR (94) qdes->I[*col] = & _dbIndicator; .. .. EXEC SQL EXECUTE InsertObj USING DESCRIPTOR _insertDesc; ...

Acorn A4
Hi, I've just finished rebuilding the battery for my Acorn A4 and I've hit a pretty major problem - the machine is refusing to charge the battery pack. It starts fast-charging (orange battery LED), then about ten seconds later the battery LED changes green then starts flashing. Does anyone have any suggestions? I don't think any wiring inside the battery pack has been damaged and I doubt any of the cells are damaged or shorted (the battery produces an output of 14.5V). Can anyone suggest anything I can try to get this battery working? Thanks. -- Phil. | Acorn RiscPC600 Mk3, SA202, 64MB, 6GB, philpem@despammed.com (valid address)| ViewFinder, Ethernet (Acorn AEH62), http://www.philpem.dsl.pipex.com/ | 8xCD, framegrabber, Teletext * <- Tribble # <- Tribble after Borg assimilation *sigh*... Never mind :-/ It looks like one of the sensor contacts pierced the insulating tape I put on one of the batteries. This was causing the battery charger to discharge the battery instead of charging it. Rather predictably, the battery voltage plummeted and the A4 aborted the charge cycle with a "Battery Faulty" error. Next time: More insulating tape on the batteries. :-/ Later. -- Phil. | Acorn RiscPC600 Mk3, SA202, 64MB, 6GB, philpem@despammed.com (valid address)| ViewFinder, Ethernet (Acorn AEH62), http://www.philpem.dsl.pipex.com/ | 8xCD, framegrabber, Teletext .... Reactance:...

Acorn DDT debugger
Hi, My copy of Castle's C++ development suite has just dropped through the letterbox. Unfortunately I've been having a bit of trouble getting the DDT debugger to work when I've got the ViewFinder graphics card enabled. Turn the Viewfinder off (i.e. use VIDC) and DDT works fine. Has anyone found a fix or workaround for this little buglet? Thanks. -- Phil. | Acorn RiscPC600 Mk3, SA202, 64MB, 6GB, philpem@despammed.com (valid address)| ViewFinder, Ethernet (Acorn AEH62), http://www.philpem.dsl.pipex.com/ | 8xCD, framegrabber, Teletext Radioactive cats have 18 half-lives On 15 Sep 2003 Philip Pemberton <philpem@tmicha.net> wrote: > Hi, > My copy of Castle's C++ development suite has just dropped through the > letterbox. Unfortunately I've been having a bit of trouble getting the DDT > debugger to work when I've got the ViewFinder graphics card enabled. Turn > the Viewfinder off (i.e. use VIDC) and DDT works fine. Has anyone found a > fix or workaround for this little buglet? DDT does work with ViewFinder. Ensure that the WimpSlot for the target is significantly larger than normal when run for debugging. Also ensure that there is enough free memory for DDT to cache the enire screen. Reduce colour depth and/or resolution to check if this is an issue. ---druck -- The ARM Club Free Software - http://www.armclub.org.uk/free/ The 32bit Conversions Page - http://www.quantumsoft.co.uk/druck/ In ...

Troubles with changing password for SYS in password file
Extract from manual tells: "If you issue the ALTER USER statement to change the password for SYS after connecting to the database, both the password stored in the data dictionary and the password stored in the password file are updated, but..." on my O10gR2 database it works as follows: 18:37:15 SQL> conn sys/oracle@orcl as sysdba Connected. 18:46:27 SQL> select username, password from dba_users where username='SYS'; USERNAME PASSWORD --------------- ------------------------------ SYS 8A8F025737A9097A 18:48:12 SQL> alter user sys identified by ora; User altered. 18:48:59 SQL> select username, password from dba_users where username='SYS'; USERNAME PASSWORD --------------- ------------------------------ SYS 03EA201D12FA4679 18:49:02 SQL> conn sys/ora@orcl as sysdba Connected. 18:49:17 SQL> alter user sys identified by values '8A8F025737A9097A'; !!! password is oracle !!! User altered. 18:50:21 SQL> conn sys/oracle@orcl as sysdba ERROR: ORA-01031: insufficient privileges !!! I cannot connect because password isn't changed in passwordfile !!! Warning: You are no longer connected to ORACLE. 18:50:31 SQL> conn sys/ora@orcl as sysdba Connected. 18:51:14 SQL> alter user sys identified by oracle; User altered. 18:51:25 SQL> select username, password from dba_users where username='SYS'; USERNAME PASSWORD --------------- --------...

kUbuntu in trouble!! Linux Programmers Demanding FINANCIAL ENGAGEMENT
Well it looks like the chickens are coming home to roost and the Linux developers, who seem to like to GIVE AWAY their hard work, are now demanding payment for such. I guess they are getting tired of seeing the likes of Redhat, Suse, IBM and others making MILLIONS off of their work. It's about time these fools wised up. It's all about money. It has ALWAYS been ALL ABOUT MONEY. http://osnews.com/comment.php?news_id=14283 http://distrowatch.com/weekly.php?issue=20060410#1 Redhat goes commercial Suse goes commercial So who will be next? Bet my business on Linux software? I don...

Manual for Acorn Desktop C (repost from c.s.a.programmer)
I've got one set of manuals - well I had the discs as well, but have disposed of them - for Acorn ANSI C release 4. I'm about to dispose of the manuals as well; unless somebody has a use for them. I'm after =A310 to cover carriage and handling. If nobody replies before 1pm, i'll be disposing of them via the trash... Dave ...

editablemovie / qtsoundtrack troubles + more troubles
I have been unsuccessfully messing around with the editable movie functions in RB. For what I thought would be a basic test, I wanted to do this: 1) Open a normal aiff soundfile via quicktime into a movieplayer 2) Then create 4 simple slider controls: 1 controls the treble, 1 for bass, and 1 for balance, and 1 for volume. This should be easy enough...right? I can't get it working. I can make various parts of the edibable movie class work, and some of qtsoundtrack. But I don't know how to combine them into a usable thing. Since I need to adjust the treble/bass, it looks l...

sys
computer common oriented http://www.freewebs.com/buildem/ http://amigos.com/go/g904313-pmem ...

sys
Is it OT here to talk about IPC and pipes? Or are all aspects of kernle programming ok here? Bill Bill Cunningham <nospam@nspam.com> wrote: > Is it OT here to talk about IPC and pipes? Or are all aspects of kernle > programming ok here? If you want to discuss how IPC and pipes are implemented in the kernel it's completely ok. But if you're interested in how to use IPC or pipes from a userland program then posting to e.g. comp.unix.programmer or comp.os.linux.development.apps will probably make a lot more sense. R...

OS/2 gurus! Help with OS/2 config.sys Fwd: Trouble with a Personal System/2
Folks, I suck at OS/2, and this guy has a problem. Config.sys has been changed. Any way to boot in recovery mode? No further info yet, unknown if this was a result of a FixPack, adapter install, or a program update. Challenge, this may be a production unit, and it may be doing involved things. -------- Original Message -------- Subject: Trouble with a Personal System/2 Date: Thu, 30 Sep 2010 20:40:20 -0400 From: <brian@centralindianapatternandmold.com> To: <ohland@charter.net> please help . config.sys got changed os2 ibm indurstial computer-will not boot? In article <npapo.23064$qU5.8268@newsfe20.iad>, Louis Ohland <ohland@charter.net> wrote: > Folks, I suck at OS/2, and this guy has a problem. > > Config.sys has been changed. > > Any way to boot in recovery mode? No further info yet, unknown if this > was a result of a FixPack, adapter install, or a program update. > > Challenge, this may be a production unit, and it may be doing involved > things. 1. Boot (C-A-D). 2. Wait for "boot blob" at top left corner of the screen (a white box, and "OS/2"). 3. Press Alt-F1. 4. Select "Boot to command prompt (use original CONFIG.SYS)" option. 5. Fix the CONFIG.SYS Alternatively, boot to command prompt from the OS/2 installation diskettes. -- Don Hills (dmhills at attglobaldotnet) Wellington, New Zealand "New interface ...

SYSMAN: No SYS$SCRATCH/SYS$LOGIN ?
$ mc sysman SYSMAN> set env/node=velo %SYSMAN-I-ENV, current command environment: Individual nodes: VELO Username JFMEZEI will be used on nonlocal nodes SYSMAN> do show log sys$scratch %SYSMAN-I-OUTPUT, command execution on node VELO %SHOW-S-NOTRAN, no translation for logical name SYS$SCRATCH SYSMAN> There is also no SYS$LOGIN defined. (VAX 7,3 and Alpha 8.3) What is the reason behind the lack of those logicals ? JF Mezei wrote: > $ mc sysman > SYSMAN> set env/node=velo > %SYSMAN-I-ENV, current command environment: > Individual nodes:...

SYS$SPECIFIC and SYS$COMMON not enough?
Basically, the idea is that stuff specific to a given node will be in its SYS$SPECIFIC directory and stuff common to all nodes (satellites or not) booting from the same system disk will be in SYS$COMMON. A good idea as far as it goes, but does it go far enough? In particular, there are two additional categories, which I'll give the obvious names SYS$CLUSTER and SYS$WORLD. SYS$CLUSTER would include stuff common to all nodes in a cluster, i.e. would differ from SYS$COMMON if there is more than one system disk in the cluster. The obvious place for this stuff is somewhere which is not on ANY system disk. SYS$MANAGER:SYLOGICALS.TEMPLATE provides (at least in newer versions of VMS, starting with 7.2 I believe) a list of at least the most common candidates among VMS system files. Add to this procedures to mount disks in a cluster, SYLOGIN.COM etc. (Obviously, I'm thinking of a cluster where as much as possible is shared.) SYS$WORLD, on the other hand, would include stuff which is common to ALL VMS system disks in the world, e.g. the executables used by VMS itself. Obviously, this should be on EVERY system disk. Put another way, the current SYS$COMMON is a mixture of stuff common to all nodes which boot from that disk, stuff common to all VMS systems in the world and, if the stuff is not located somewhere else (pointed to by logicals in the case of VMS system files), stuff common to all nodes in the cluster (perhaps duplicated on more than one system...

Acorn Publisher / Acorn User / Qercus
By now some people should have received their copy of Qercus - ie issue 268 of Acorn User or vol 10 issue 1 of Acorn Publisher. The additional printing numbers and distribution is new to us so we're not sure how long it will take to get to all subscribers or to be available in the shops. Some bulk mailings to overseas customers may not go until next week. Our experience so far with the database we inherited from Tau Press is that some customers will receive duplicate copies of the magazine whilst others will not receive one at all. We have been working hard to put right as many errors as we could identify but we know there are still some problems remaining. If you receive an extra issue will you please let us know and tell us which reference numbers are on the two (three/four!) labels so that we can put it right for next time. Please don't return any copies - donate duplicates to a friend, library, dentist/doctor's waiting room &c If you don't receive your copy (UK) then please do not let us know until the middle of next week; we have arranged to do *another* sweep of the database after the SW Show and may have sorted out outstanding problems by the time you call. Whilst far-flung Acorn User subscribers should receive their copies faster than before they should give it an extra week at least before reporting non-receipt. For this occasion reminders have been sent separately from the magazine and should have already been received by UK subscribers who n...

com.sys & vcom.sys
It's been a while since I last installed 1.1 and when I did it yesterday I forgot to de-select Ray Gwinn's com drivers. After installation I removed the entries from config.sys and un-remmed com.sys and vcom.sys but they won't load. I checked and it's in c:/os2/boot. What's the cure? :-) Wayne -- While the e-mail address in this post is genuine it is only used as a spamtrap. Any mail sent to me at this address will be considered to be spam and deleted without being read. Wayne wrote: > It's been a while since I last installed 1.1 and when I > did it yesterday I forgot to de-select Ray Gwinn's com > drivers. After installation I removed the entries from > config.sys and un-remmed com.sys and vcom.sys but they > won't load. I checked and it's in c:/os2/boot. What's > the cure? :-) They must come after mouse/vmouse/pointdd device drivers in the config.sys file. Stu/2 On Tuesday 05 Oct 2004 17:06 Stewart Buckingham wrote: >> It's been a while since I last installed 1.1 and when I >> did it yesterday I forgot to de-select Ray Gwinn's com >> drivers. After installation I removed the entries from >> config.sys and un-remmed com.sys and vcom.sys but they >> won't load. I checked and it's in c:/os2/boot. What's >> the cure? :-) > > They must come after mouse/vmouse/pointdd device drivers in the > config.sys file. I believe they are, I checked while I was...

com.sys and usbser.sys question
I got a question, for those knowing more about that matter than myself, which shouldn't be hard ;-) Temporarily having 2 phone lines at my disposal, I wanted to put my old modem back to use as a phone number dialer, using the BonusPack PIM Phonebook application. But I had quite some trouble to get my COM1 port to work at all with any comm application. It finally turned out, that COM.SYS has to be loaded before USBSER.SYS, since otherwise USBSER.SYS is hijacking COM1 unnoticed. Now, in the order shown below, it assigns itself to COM6 (if not remed out), but COM1 still d...

SQLRef
Dear All Software Developers, I am a hardcore programmer who treat programming as a hobby. Recently, I have just created a website (http://www.sqlref.com) to share my knowledge and programming experience and to record down any new tricks that I learned. This website started with SQL info. becaue I think SQL is the most basic but must know thing for all software developers. Eventually, I will make this website covers other topics such as .NET, SQL Server, Oracle, DB2 and so on. I will update it everyday. I think all developers should be able to access the SQL reference / Guide at any time, any place. Thus, I created this website for anybody who need reference on SQL. While you are doing programming and stuck with the SQL syntax, just open you web browser and type http://www.sqlref.com to look for you answer. I guess sqlref.com is easy enought to remember. No registration is required because I am not selling or marketing anything. Just a website for programmers to refer. I hope the website is useful to you all. Enjoy! Warmest Regards, Allen A hardcore programmer using Frontpage to build an ad-ridden site? Nice, real classy. <link rel="stylesheet" type="text/css" href="_themes/blends-sql-ref/blen1011.css"><meta name="Microsoft Theme" content="blends-sql-ref 1011"> Thanks for your effort...site almost did not load in Firefox, and loading in FF is probably also a hard-core criterion...I imagine FP is what y...

work for Calrion programmer (programmer needed)
Hi, we need a Clarion programmer to do some work in Calrion environment (need to fix some things in Clarion database) please e-mail to nick@primedebtsoft.com What kind of things? Is this extensive or just a simple verify app? How much? -- Thanks, John Hamilton POSitive Software Company http://www.gopositive.com "PrimeDebt Soft" <sal@primedebtsoft.com> wrote in message news:f408276d.0307281220.4951036f@posting.google.com... > Hi, > > we need a Clarion programmer to do some work in Calrion environment > (need to fix some things in Clarion database) > > please e-mail to nick@primedebtsoft.com ...

Trouble with ;
Hi, If I eval this expression on a workspace, I get an 'error: yourself not defined': |x y z| x := OrderedCollection new addFirst: 1; addFirst: 3; addFirst: 45; yourself What amI doing wrong? O:-) Thanks On Thu, 02 Dec 2004 12:00:34 +0100, Fernando <frr@easyjob.net> wrote: > If I eval this expression on a workspace, I get an 'error: yourself > not defined': > > |x y z| > x := OrderedCollection new addFirst: 1; > addFirst: 3; > addFirst: 45; > yourself Did you select all the co...

Programmers
I'm looking for a contract programmer to do some rather intricate SW customization. I can be contacted at gmann@factorone.ca Greg Mann ...

Web resources about - Textwrap Trouble! - comp.sys.acorn.programmer

Edward Rothstein: Latest Internet Religious Offering is High Holy Days Services
It's the High Holidays," proclaims the banner headline. "Can't Get tothe Temple? Get to the Computer." It is unlikely that many Jewish worshipers ...

Advertise/PR — 5 Minutes for Mom
Blog post at 5 Minutes for Mom : #af-form-1665285021 .af-body .af-textWrap, #af-form-1665285021 .af-body .af-checkWrap{width:98%;display:bl ...

Baking
BlenderBabesNewsletter .af-textWrap { width: 69%; display: inline-block; } .af-element input.submit { width: 100%; letter-spacing: normal; font-si ...

Molly Hahn: *Just Breathe*
... Doodle is available as a limited-edition archival print. Click this link to order: http://bit.ly/18Gk4eZ #af-form-1539194893 .af-body .af-t ...

Data Relationships 2.0
#af-form-260416866 .af-body .af-textWrap, #af-form-260416866 .choiceList-radio-inline, #af-form-260416866 .choiceList-radio-stacked{width:98 ...

- Kim Garst – Social Media Strategist, Personal Branding Specialist, Social Media Training, Social Media ...
... Social Media Coaching - KimGarst.com :   True Gold Buried In These Pages...Learn How To Stand Out!   #af-form-1556419941 .af-body .af-textW ...

Single-site warm « SEOPressor – Best SEO Wordpress Plugin
Single-Site License Purchase Please enter your primary email address to proceed #af-form-1280874874 .af-body .af-textWrap{display:block;floa ...

New Bonus For Stella Culinary Newsletter Subscribers
#af-form-1624118044 .af-body .af-textWrap{width:98%;display:block;float:none;} #af-form-1624118044 .af-body input.text, #af-form-1624118044 .af-body ...

Contact – True Web Presence
#af-form-1786829251 .af-body .af-textWrap{width:98%;display:block;float:none;} #af-form-1786829251 .af-body .privacyPolicy{color:#000000;font-size:11px;fon ...

HowToCookThat : Cakes, Dessert & Chocolate - Subscribe to How To Cook That - HowToCookThat : Cakes, Dessert ...
Sign up for email updates from How To Cook That New crazy sweet creation every Friday#af-form-249646002 .af-body .af-textWrap{width:98%;disp ...

Resources last updated: 3/25/2016 11:41:39 AM