I am NEW to GitHub, I have just spent a lot time trying to figure out how mark this repository as Clarion code, no luck yet.
Regardless, years ago I took the code from Text Formatter chapter in Software Tools in Pascal by Kernighan & Plaugher and converted that to Clarion. I needed to implement a letter writer that could format paragraphs from a letter type file and then substitute variable names with data. I also needed to format text in specific size boxes that could be placed on a printed form.
The ReadMe.md file on GitHub shows how to run an example that displays in a message box.
Hopefully at some point I find the settings for specifying language on GitHub,
Include the generated CLW files (TxtFo*.Clw) which CLW extension is seen as Clarion which APP is not.
They are nice in the Repo so we can see what the code does without having to open the APP and generate. They are also helpful if someone does build the APP they can compare their generated CLW’s to yours to see if there are template differences. Also include other generated files like INC,EXP,…
Its also good to create a TXA of the APP and put that on GitHub. The TXA usually can be loaded into older versions where the APP would be rejected. If you have a DCT also export and include a DCTX.
Example of the School APP on GitHub with the TXA, CLW, INC files:
So. . .AI directions for some GitHub stuff need human help. Found .gitattributes and also language is configured automatically, which is why adding .clw files works.
Thanks for the link. I don’t have the book, borrowed it in the 80’s and have photocopy of the text formatting chapter. Myself and long time friend did a lot of Pascal. Since you have the book you have the documentation for the Clarion code to format text. Some years later Alan Holub (Dr. Dobb’s) had his version of nroff (NR written in C) for sale. I bought that and used it to create a reporting system where I could automatically float columns of data horizontally across, for a DNA/Blood typing laboratory. This code was way-to-overkill to use for Clarion solution.
A tip is since at least Clarion 4 the Procedure Prototype and Parameters can be the same with both as (TYPE Label). The makes it easier you can type the Prototype then copy/paste into Parameters … except no Return type on the end.
I mostly like this because in the Embeditor at the top your Parameters shows Types so I know its a *STRING and LONG.
Actual example, note Return of “BOOL,PROC” is not in Parameters. The Default =FALSE can be in Parameters, but the actual value used is from the Prototype.
One other tip is the Prototype and Parameters can have different Labels. In the Prototype I’ll put more verbose labels that are more like documentation, this shows in the Intellisense popup. In the Parameters I’ll put more terse variables that I want in code. E.g.
MAP
FormatText(*STRING InTextToFormat, LONG SizeOfInText)
FormatText PROCEDURE(*STRING pTxt, LONG pLengthTxt)
Some years later Alan Holub (Dr. Dobb’s) had his version of nroff (NR written in C) for sale. I bought that and used it to create a reporting system
If it would not be too off topic, would you be able to say whether the Holub nroff book had additional changes or details beyond what was published in Doctor Dobbs Journal?
I retrieved and have been putting together the listings from DDJ for nr, but finding the book has proven impossible. Sorry for the bother, you are my only lead at this point.
AnImplementationoftheUnixNroffWordProcessor/IncludesDisk
by AllenHolub, HelenHolub Hardcover, 89 Pages, Published 1987 by M & TBooks ISBN-13: 978-0-934375-33-7, ISBN: 0-934375-33-X
but I probably have the Dr Dobbs articles/code stored away somewhere - but it sounds like you already have that.
depending what you want it for I wonder if Groff is an alternative?
It is GNU software so the viral GPL 3 aspect may be a problem depending what you want to use it for.
AI says:
Nroff (Next Run-Off) is a classic document markup and formatting utility developed in the early days of Unix. Unlike modern WYSIWYG word processors, it relies on plain-text source files embedded with “dot commands” (e.g., .sp for space, .ce for center) which are then compiled into formatted terminal or printer output. [1, 2, 3, 4, 5]
How the Unix Nroff System Works
Nroff and its typesetter-oriented counterpart, troff, function by reading a plain text file, processing the formatting commands, and outputting the text in neatly justified, paginated form. [1, 2, 3]
Because raw nroff syntax can be very low-level, most users rely on macro packages (such as -me, -ms, or -mm) to handle the heavy lifting for common document layouts. [1, 2, 3]
Modern Implementations
While the original nroff was designed to format output for typewriter-like teletype terminals, modern Unix-like systems (including Linux and macOS) use groff (GNU troff). The groff package contains a GNU implementation of nroff that acts exactly like the classic tool, but is enhanced to generate UTF-8 character output and high-quality PostScript or PDF files. [1, 2, 3]
One of my favorite stories about Unix is how it turned
into a text processing system. Brian Kernighan tells the
story in his book Unix: A History and a Memoir (chapter 3)
but to summarize:
The Unix team at Bell Labs ran the original Unix on
a PDP-7 computer, but it was a tiny system and didn't
have sufficient resources to support new work. So Ken
Thompson and others lobbied to purchase a new PDP-11
computer. Management denied the request. Around the same
time, the Patents department planned to buy a new computer
platform to produce patent applications using proprietary
document formatting software. The Unix group proposed
that the Patents department instead buy a new PDP-11 for
the Unix team, and the Unix team would create formatting
software for them.
That new formatting system was called nroff, short for
"New Roff," an updated version of a text formatting program
called Roff from a 1960s computer system. The name Roff
came from the old expression, "I'll run off a document."
Thanks, yes I was able to find the DDJ articles and wonder if the book provided further updates or details.
I’m interested in roff formatters in general and running Holub’s Nr under Minix[1] and DOS on a retro computing project to run on a 286.
Groff and heirloom troff[2] are great, but a bit heavy for that scenario.
Mark Williams had a pretty solid version of nroff and troff for Coherent on the same hardware.
Note: links are blocked.
As mentioned in the patch with a file list from 12/12/88 on comp.os.minix, which appears on groups dot google dot com at /g/comp.os.minix/c/uXxASkLNIuc/m/RANr-vZejrIJ
this happens when you are “new” to stop people coming in and posting malicious or inappropriate links. Once you have been around a while reading and posting, your status level will improve and you can effectively be considered “more trustworthy”.
I asked Gemini about the book and where it could be found eg. either a digital download or physical book - its answer indicates the book had the info from the DDJ articles so perhaps you already have everything? It said:
Finding a direct digital download of the standalone hardcover edition of An Implementation of the Unix Nroff Word Processor (ISBN: 0-934375-33-X / 978-0-934375-33-7) can be challenging because M & T Books never released a standalone e-book version before going out of print.
However, because of how this book was originally published, you can access both the complete text and the accompanying source code disk legally online today.
How the Book Was Created
Allen Holub originally developed NR (a complete, customizable text formatter written in C, compatible with Unix nroff and troff macro concepts) for his “C Chest” column in Dr. Dobb’s Journal (DDJ).
Because the project was so extensive—featuring macro processing, number registers, diversion traps, proportional spacing, and automatic table-of-contents generation—M & T Books (the publishing arm of Dr. Dobb’s Journal) packaged the complete documentation and source code into the 1987 hardcover book and floppy disk release.
Where to Download the Text & Documentation
Since the book is directly derived from Holub’s three-part serialization in Dr. Dobb’s Journal, the complete text, architecture breakdowns, and usage manuals are preserved verbatim in the archives of Dr. Dobb’s Journal Volume 12 (1987).
You can freely download or read the complete scans of these issues via the Internet Archive:
Part 1 (Core Architecture & Command Parsing):Dr. Dobb’s Journal, January 1987 (Issue #123)
Part 2 (Hashing, Expression Evaluation & Roman Numerals):Dr. Dobb’s Journal, February 1987 (Issue #124)
Part 3 (Macro Processing, Diversions & Output Traps):Dr. Dobb’s Journal, March 1987 (Issue #125)
Pro Tip: You can download the entire Dr. Dobb’s Journal Volume 12 Bound Collection in PDF, EPUB, or Plain Text format directly from the Internet Archive’s DDJ repository (archive.org/details/dr_dobbs_journal_vol_12). Holub’s NR implementation spans the C Chest columns across those first three issues.
Where to Download the Accompanying C Source Code
The contents of the included floppy disk (containing the complete C source code, header files, sample printer configurations, and documentation) were distributed through public domain C archives and Dr. Dobb’s software companion disks. You can find the extracted disk contents in several software repositories:
Internet Archive (Walnut Creek & CUG CD-ROMs): The source files for Holub’s NR implementation were mirrored across early software compilations, including the C Users Group (CUG) library and Walnut Creek C CD-ROM snapshots hosted on archive.org.
University of Utah Math & CS FTP Mirror: Academic mirrors that archive classic typesetting and Unix tools (such as ftp.math.utah.edu/pub/tex/bib/) preserve bibliographic pointers and code releases from Holub’s Dr. Dobb’s publications.
GitHub Retro-Computing Repositories: Several historical code preservation projects on GitHub host the extracted DDJ 1987 source code disks. Searching GitHub specifically for the 1987 DDJ source archive or Allen Holub nr.c will yield the complete compilation files ready to inspect or compile.
Hunting Down a Physical Copy
If you are looking to acquire the physical 89-page hardcover book and original 5.25" disk for a collection, your best route is setting up automated ISBN alerts on used-book aggregators:
Search Targets: Use both the 10-digit (093437533X) and 13-digit (9780934375337) ISBNs without hyphens.
Recommended Marketplaces:
AbeBooks & Alibris: Best for rare technical and university surplus books.
eBay: Set a saved search alert for “Allen Holub Nroff”; vintage M&T Books programming packages surface periodically from estate sales of retro-computing enthusiasts.
I have the NR book, I just boxed it up a month ago. It will take a few weeks, away for a bit, but I’ll retrieve it and look. If it’s not copyrighted I have no problem photocopying it. I sent Allen Holub an email, earlier this year, and thanked him for the software I bought and used in a complicated multiple state’s contracts, 1980/90’s, for reporting data where each state had different requirements for report output. I created some of my own macros. One was to switch directories based on contract in order to select different text and macros. I received a VERY NICE REPLY back from him.
mjkuhn
If it’s not copyrighted I have no problem photocopying it. I sent Allen Holub an email, earlier this year, and thanked him for the software I bought and used in a complicated multiple state’s contracts, 1980/90’s, for reporting data where each state had different requirements for report output. I created some of my own macros. One was to switch directories based on contract in order to select different text and macros. I received a VERY NICE REPLY back from him.
Sounds great, I appreciate it! I think [nt]roff still excels in this area of report and form generation on fixed media.
I’m also traveling at the moment but will add for anyone looking in the future that the full NR articles covering all the code ran from 1985-87.
They were not included in the C Chest book or copies of the DDJ listings on bulletin boards.