Re: Has anyone written a word wrap routine for text?
Posted in 1992
Path: emory!swrinde!cs.utexas.edu!asuvax!anasaz!qip!briand From: briand@anasaz (Brian Douglass) Newsgroups: comp.databases.informix Keywords: informix Message-ID: <1992Jan28.211648.3525@anasaz> Date: 28 Jan 92 21:16:48 GMT References: <1992Jan21.163335.14195@cbnews.cb.att.com> <1604@das13.snide.com> <1992Jan25.020930.25632@ddssuprs.uucp> Organization: Anasazi, Inc. Phoenix, Az In article <1992Jan25.020930.25632@ddssuprs.uucp> lpc@ddssuprs.uucp (Luis P Caamano) writes: >In article <1604@das13.snide.com> dave@das13.snide.com (Dave Snyder) writes: >>In article <1992Jan21.163335.14195@cbnews.cb.att.com>, mvctm@cbnews.cb.att.com (carl.t.mosley) writes: >>-> I am using 4GL 1.10 w/ SE. Has anyone come up with a way to create >>-> "memo" fields? If I put the following fields in a screen form >>-> >>-> I would like to somehow combine the separate fields into one, or the >>-> illusion of one, program variable so that when the user is typing away >>-> the words automatically wrap down to the next row. >> >>Informix 4.0 will allow you to specify WORDWRAP in your form specification. >> > >That's a "neat" feature that I've never used since WORDWRAP works >only on a single big field splitted on the screen. If the user only >types on a single line you waste the rest of the field on the database. >OK. Let's use VARCHAR. Sure, but how big will you make the field on the >form? Well, 6 lines would be fine. What if the memo takes more than >six lines? well, ... and so on ... > >What I really want is to have a table called 'lines' with two >fields, one the document id (the join) and the other one is >the line field. Then I'll define a 6 lines array field on the form >with a max program array of let's say 300. That would give me a 300 >lines memo pad. Then I use my input array on the field and then >you'll have a efficient memo field. If the user only types one >line then I'll have only one record on the lines table. It's here >where I want a wordwrap feature. As you might guess what I want >is the wordwrap feature implemented on a another kind of input >array command or the WORDWRAP feature with scrolling capabilities >on a VARCHAR field. Get the idea? Boy does this bring back some memories. I did this ~1985 in 1.10. A system I wrote from the Army Corps of Engineers called Indexer. The intention was to provide "memo" field capability in Informix. (BTW, a friend of mine developed the memo field using Dbase 2.2 on a CP/M machine for the 1984 Olympics. AT was so impressed and its so simple that they put it in DBASE III) Instead of trying to use variable length text in the database (indexing it is a waste of space, and any kind of search is only sequential), keep it outside in its own text file. Write a routine in C, either standalone or in the fglgo runner, that is passed a directory path (/u/indexer), and a number (22), usually the value of a serial field in the record you working on. This function then makes a unix call forking to the word processor of choice with the proscribed file name (/u/indexer/22). Now the user is using their favorite WP or editor, they can type in all they want, format it however they desire, and upon exiting return to their 4GL screen. My Indexer system kept track of creation times, modification times, last print date, key words in a 80 character indexed fields, author, typist, etc. All the little goodies that Word Perfect now toutes. When you want to print it, if its ascii no problem, if not, I kept another variable (WPEDIT=editor, WPPRINT=print program) with the print routine necessary to output the file. Now, of course 4.0 and VARCHAR etc. do most of this now. But for any SE junkies out there, making a call to a WP always worked pretty good for me. Hope this helps. -- Brian Douglass briand%anasaz.UUCP@asuvax.eas.asu.edu 602-870-3330 X657