------------------------------------ 3]TEXTER: It Slices! It Dices! 3]By J.E. Charlsen, Marina del Rey, CA ------------------------------------ 3] (EDITOR'S NOTE -- The unusual formatting of this article is purposeful. 3]The ragged line lengths come into play when this file is used by the 3]program TEXTER to show its capabilities. "Texter" was written to automate some of the things too many of us have wasted too much time doing. Namely? Sitting in front of our screens hand-filtering, chopping up and reformatting text files. It seems a simple task for a computer. So why has no one has done it before? Probably because a corporation couldn't charge enough for it to make the project profitable. Please excuse the verbosity and the erratic formatting. One of the reasons for this file is to give the program (Texter) something to work on. Many of the options chosen while using "Texter" can be UNDOed. Granted, you can only go back one step, but it's better than nothing. The operations which can't be undone are those which generate multiple files. Upon exiting the program SOME of the files it has created will be DELETED. The exceptions are the broken up files (Chunk#??) and the last file that was worked on. I've done everything I could think of to make "Texter" well behaved for the multi-taskers among us, but thought I'd leave the result files in RAM: to be further massaged by other programs for those who haven't mastered doing more than one thing at a time. A warning! "Texter" may have as many as five(!) copies of a file in RAM: at once. So don't be shocked by it's apparent RAM: appetite. Let's see: 1. The source file 2. The "work" file it's formatting (or whatever). 3. and 4. The files it's splitting the formatted file into (in the case of odd/even pages) 5. The UNDO file. Oh, I almost forgot the "Chunk #1" thru "Chunk #XX" files which result from "BreakUp" operations. So if you run into memory shortage problems you might want to manually remove (or move) some of the files from RAM: to a disk for further work. Or you can change the output device (Dev$) in the program listing to have the files routed automatically to a DF?: or HD?: One of the options will break up text files to be sent to "BBS-PC" bulletin boards. A shortcut I took on that one was to pad the empty spots in the file with spaces. The program is large and it is Basic. Yes, it could be made smaller, have more options, be more efficient and ported to another language. So? What couldn't? I would like feedback though. If you find bugs that can't be easily figured out and/or circumvented, let me know. It is compilable with AC-Basic. Within the first few lines of the program are a number of parameters which can be altered to suit the individual user. These can be viewed by using the right button on the SETTINGS selection. The choices were to do it that way OR to have a separate file to load your choices every time OR to reset the parameters with a little slider gadget. I chose what I chose what I chose. If you'd really have something fancier, let me know: Jim Charlsen, 3300 Thatcher Ave. #15 Marina del Rey, California 90292 Among the things I chose not to include were the ability to recognize printer codes or escape characters or the dreaded "dot commands." The program isn't meant to be a heavy-duty utility. It's more hand tool than industrial workshop. I kind of lean toward simple tools, like hammers. By the way, "Texter" in conjunction with "TxEd Plus" by Microsmiths is a very powerful combination. "Texter" may have some difficulty differentiating between a series of lines and a real paragraph. The way I worked around this: If there's a blank line OR a line that ends more than 7 characters from the right margin THAT'S a paragraph. Armed with that knowledge, you now know where to insert an extra carriage return (blank line) if there's a problem. An obvious (to most) hint: To pause a bunch of lines which are scrolling off your screen too fast, press a mouse button. Another clue to the 90 percent not intimate with Basic programming. To get an ASCII listing, the file must have been saved using the following format from within Basic: SAVE "DEV:FILENAME",A Don't forget the quotes! Some operations may not not appear correctly in the lower window. To double-check on the results, use the "Review Last Operation" option. The ".bmap" files are required to speed up Basic's text display. Sorry. Every once in a while you may find yourself in the process of a procedure which is too boring, dumb or just a plain old mistake. For such unlikely circumstances I have assigned a "Magic Corner" which, when clicked, will abort the "Texter" process and land you (I hope) back at the main menu. Top left corner, top screen. ++++++++++++ "Textercizes"--------------------- Here are the options arranged goofily, but "Texter" will straighten them right out (in the hands of a skilled "Texterizer"). 1 Strip/Add/Swap CRs/LFs 2 Strip Spaces and/or Tabs 3 Remove REMarks (Basic) 4 Remove/Add Blank Lines 5 Number Pages 6 Add/Remove Line Numbers 7 Columnize (2 columns of 35 chars) 8 ReFormat (try 30-79 chars) 9 Format for BBS-PC 10 Review Results of Last Operation 11 Additional Operation (same file) 12 Undo Last Operation 13 Break up into ??K sized chunks 14 Make 2 Files (Odd/Even Pages) 15 Change Source FileName 16 Save results to file or PRT: 17 List Files 18 Quit ****** EXAMPLES **of*stuff*that*can*sometimes*drive*Texter*NUTS***************************** $123 43% 832& 23¼ <--- TABbed out $12345 666.6667 $56789 98765.3 789.00 897 dollars 67584 66686¾ ABC=1 <----- Spaced out .... nahh Sometimes you'll run across the darndest things. Take a bunch of short lines for instance. "Texter" doesn't seem to like that. Most of the time it'll run them all together. Of course, if you go to the trouble to add blank lines in between them it's no problem at all, whatsoever, in the least. Really, you have my word on it. * Millay text * Well, I have lost you; and I lost you fairly;| In my own way, and with my full consent.| Say what you will, kings in a tumbrel rarely| Went to their deaths more proud than this one went.| Some nights of apprehension and hot weeping| I will confess; but that's permitted me;| Day dried my eyes; I was not one for keeping| Rubbed in a cage a wing that would be free.| If I had loved you less or played you slyly| I might have held you for a summer more,| But at the cost of worlds I value highly,| And no such summer as the one before.| Should I outlive this anguish - and men do -| I shall have only good to say of you.| '******************* Thus far **************** REM a not very good example of Basic programming 02 WayTooMany = 6 OR 10± AT Least 10 WHILE Kansas <> NoPlaceLikeHome 15 20 FOR Eye=ONE TO WayTooMany 30 GOTO 711 42.5 NEXT Eye 49 WEND GOTO WINDOW: DRAW DRAPES: RETURN 711 PUT G$ ON Fido 712 WHILE Fido = Embarrassed GOSUB RollOnFloorLaughing WEND your WAY REM Or was it "MEND your ways? SubRoutine: 50 REM ***** Why do programmers use all those asterisks? ***** 60 ' <-- Another way to REM SixtyOne 'is to use these little things ''''''' LXII " END OF BASIC LISTING": REM stops here If we have a line with "quotes" in it, followed by (or enclosing) REM's I shan't be held responsible for the results. Call Judge Wapner, sue me, see if I care. BTW is it true that Rusty had quite a career in western films during the '40s and '50s? Then sometimes you'll run across lines that just go on and on for the longest time for no apparent reason and when you get to the end of them it hardly seemed worth the trouble in the first place if you catch my drift nudge nudge wink wink. Slathering spaghetti sauce inside cheese sandwiches before grilling makes for a real taste treat! Call me old fashioned but I sure miss the original "Gong Show". Now it's in STEREO! (where available) no less. And WHERE'S CHUCKIE??? Computer analysis as proved beyond any doubt that due to the proliferation of mini-malls 83% of Americans will be able to order at least 4 kinds of fast-food AND have their dry cleaning done by simply shouting their orders out of the windows of their hom 1 2 3 4 5 End of "Texter.txt" --> or was it here?-> Page #396¾