1 CONSTRUE

 CONSTRUE is a Macintosh file to Vax file conversion program.  It reads
 128 byte fixed length record files (the kind that MACX, XMODEM, and XBIN
 produce), and outputs a standard Vax variable length record file.
 To run it, put into your LOGIN.COM
 
 $ CONSTRUE :== $disk:[directory]construe.exe
 
 then you can type
 
 $ CONSTRUE[/q1.../qn]  input_file [output_file]
 
 If you don't provide an input file name, you will be 
 prompted for both input and output files.  The default 
 output file is sys$output.

 CONSTRUE can currently handle files from MacWrite (versions
 2.2 and 4.5), Microsoft Word (1.0n and 3.0), Acta and
 straight TEXT (<cr> at the end of paragraphs).  You can
 change defaults for some of the formatting by using the
 qualifiers.  These changes apply to the entire document, so
 while you may be able to improve the formatting of some
 paragraphs, it may degrade the formatting of others. 

 The file type is determined from the first line of the 
 file, which by default is assumed to be in MacBinary or 
 MacTerminal format.  If you want to read a file format that 
 I don't support, it's sometimes useful to try /TEXT/NOHEADER.
 
2 General


                      CONSTRUE 1.4
         Copyright 1986, 1987 by Sally Weaks.
       Non-commercial distribution is permitted.
  
 CONSTRUE 1.4 converts Macintosh text and word-processor
 files to Vax text files.  I originally wrote it so that I
 could read the Mac documentation that we have archived on
 our Vax without having to download the file, swap floppies
 to MacWrite, or Word, or whatever, then load in the file
 only to find out that it wasn't what I wanted in the first
 place.  Another use that was discovered after the fact is to
 convert spreadsheet and other tab-delimited data with very 
 long records (saved text only) to a format that can be 
 imported into some Vax spreadsheets, databases, etc. 
 
 CONSTRUE currently supports MacWrite (2.2 and 4.5),
 Microsoft Word (1.05 and 3.0), Acta, and straight text (<CR>
 at the end of paragraphs).  I only look at the formatting
 information for MacWrite, because those file formats are
 well documented (brain-damaged, but at least documented). 
 Acta format is also documented, but most of it deals with
 which sections are hidden.  I will add better formatting to
 Word as soon as I get some formatting details and some time.
 
 I read the input file into a global section, both to improve
 speed and to make random access at the nibble level
 straightforward.  The input file must have fixed length
 records, currently 128 bytes, though I may make that more
 flexible in the future.   Since I use LIB$GET_FOREIGN to get
 the command line to parse, it isn't necessary to do a SET
 COMMAND except to build the program. This saves time at
 login, and makes running the program simpler for
 non-programmers. 
 
 CREDITS:
 
 While CONSTRUE was my idea, and I made most of the decisions
 (good and bad), I had two large chunks of help.  The global
 section routines are based on Kelly Green's MAPFILE program,
 which he wrote as an example of how to use global sections. 
 The ARRAY_FILE assembly routines that access the global
 section in appropriate sized chunks were written by Gordon
 Davisson, who also wrote XBIN, the binhex-to-MacBinary file
 converter included on this tape. 
 
 Send bug reports, suggestions, complaints and contributions to:
 
        Sally Weaks
        Department of Physics FM-15
        University of Washington
        Seattle, WA  98195
 
        BITnet:      sweaks@uwaphast
        uucp:        {ihnp4}!uw-beaver!uw-june!phastvax!sweaks
        Delphi:      ALLYN
        Compuserve:  75325,561
  
2 Defaults
 
 Only MacWrite files get their default formatting parameters
 from the file.  For other types, I have set up defaults. 
 
 For MS Word and straight text files, these are:
        Left margin:   column 1
        Right margin:  column 80
        Indentation:   5
        Spacing:       single space
        Tab stops:     8 spaces wide
 
 For Acta files, I use the above defaults for the margins and
 tab stops, but the indentation for each level defaults to 4
 spaces. 
      
2 Parameters
  
 P1 = Input file-spec.   
 
   Input files must be 128 byte fixed length records. This is
   the format used by MACX (available on an earlier DECUS tape)
   and XMODEM when uploading files to the Vax, and the format
   used by XBIN (the binhex to MacBinary converter). 
   
 P2 = output file-spec.  
 
   Default is sys$output.  Output files are standard
   variable-length records suitable for use with EDT. 
 
  
2 Qualifiers
  
/HELP

 Produces a shortened version of this information.
  
/LOG
 /LOG [= filespec]

 Keeps a log file of informational messages that would
 normally go to sys$output (including this HELP).  Default
 file-spec is CONSTRUE.LOG.  If the file can't be opened in
 your default directory, it is opened in sys$scratch:. 
  
/HEADER
 /HEADER     default
 /NOHEADER

 /HEADER forces CONSTRUE to treat the first record as a
 MacBinary header, even if it doesn't recognize the file
 creator, etc. It is useful with /TEXT, as there are many
 programs that produce text-only files. 
 
 /NOHEADER will force the first record to be treated as part
 of the text. When used with /TEXT, the entire file (resource
 fork and all) will be processed, so you may need to trim
 garbage from the output file.  If you use it with some 
 other file format, CONSTRUE will likely die with an access 
 violation, as it gets lost in a maze of invalid pointers.
 
/MACWRITE
 /MACWRITE

 Forces MacWrite format.  In the absence of other formatting
 qualifiers, CONSTRUE will read the MacWrite rulers to set
 the margins, indentation, spacing, and tab stops.  If you
 use a qualifier to change the formatting information, such
 as setting the right margin to 60, it will apply to the
 entire document. 

/WORD
 /WORD

 Forces Microsoft Word format.  Since I don't yet know how to
 read formatting information, I use the standard defaults. 
 (See Defaults.)

/TEXT
 /TEXT

 Forces text-only format.  This is sometimes useful for odd file
 formats, as data is often stored in a readable form.  This
 will get what text it can in a more useful format than DUMP
 will. 

/ACTA
 /ACTA

 Forces Acta format.  The default indentation is 4.  You can
 change this with the /INDENT qualifier. 
 
/MARGIN
 /MARGIN=(lm[,rm])

 Sets the margins.  lm = left margin, rm = right margin. The
 default value of rm is 80 for anything other than MacWrite
 files; if rm is negative, it is subtracted from 80.  If
 positive, rm must lie between lm and  32000.  Large values
 of rm can be useful for transferring spreadsheet or database
 files. 
 
/INDENT
 /INDENT=n      

 Sets the indentation for the first line of a paragraph,
 referenced to the left margin. n can be positive or
 negative.  If negative, and the absolute value is greater 
 than the value of the left margin, it will be reset to the 
 first column.
 
/EXPAND_TAB
 /EXPAND_TAB    default
 /NOEXPAND_TAB  

 Expands tabs with spaces to the tab stops.
 
 /NOEXPAND_TAB lets tab characters pass through unchanged.
 This will almost always mess up the word wrap, but allows
 conversion of files that need tab delimiters. 
 
/TABS
 /TABS=(n1[,n2,n3,...,n100])

 Sets the tab stops.  If only one value is given, a tab
 is set in every nth column.
 
/SPACING
 /SPACING=n     

 Sets single or double space.  n = 1 or n = 2.
 
2 Problems
 Many apparent problems are due to the 
 difficulties of converting text that was formatted for 
 a proportional font to a fixed-space font.  This is 
 particularly bad for things with lots of irregular tab 
 stops.  Changing the default formatting can help, but 
 sometimes at the expense of making other paragraphs worse.
 The ruler settings in MacWrite are given in screen pixels, 
 which I convert to character widths by making assumptions 
 about 80 column output on the Mac screen.

 If you see a lot of odd characters like 'P', and 'Q', and
 'S' showing up in the output file, it's because the original
 document was using special characters with the eighth bit
 set for open and close quote, different sized dashes, etc. 
 When you then TYPE the file on the Vax, the eighth bit is
 ignored, and you get seemingly inappropriate characters. 

 If you use /NOEXPAND_TAB, the word wrap algorithm counts 
 the tab as a single character, so wrapping almost always 
 comes out wrong.  This will get fixed in the next version.

 I think that I'm reading the MS Word 3.0 text correctly,
 but I haven't been able to test it on a wide variety of
 documents yet. 

 If you find any other deficiencies, bugs, or mis-features, 
 please tell me about them.

        Sally Weaks
        Department of Physics FM-15
        University of Washington
        Seattle, WA  98195
 
        BITnet:      sweaks@uwaphast
        uucp:        {ihnp4}!uw-beaver!uw-june!phastvax!sweaks
        Delphi:      ALLYN
        Compuserve:  75325,561

2 Improvements
 If there is enough interest, future versions may include:
 
     wildcards in file names
     more file formats  (WriteNow, WordHandler, FactFinder, etc.)
     improvements of tab handling and word wrap, such as 
           word wrap properly even if you've used /noexpand
     more complete file formats: i.e., look at the formatting information
           in the rulers as I already do for MacWrite.
     /verbose  to extract all available information from the header
           such as date created, date modified, Mac filename.
     /[no]eight_bit  to strip the high bits.
     /common_char to set the common character list for MacWrite 4.5
           This would allow files from other countries to be interpreted
           correctly.
     /resource  to get useful information from resources, such as
           the MacWrite common characters.
     /translate  to translate any character into any other character
           This is useful to change `smart quotes' into something legible,
           (left and right quote characters, different length
           dashes, all of which show up as eighth-bit set
           characters, that often look like 'P','S','Q' etc. when
           you type the file) or to map a Mac special character
           font into a non-Apple laser printer font. 
     /[no]page  to put in page breaks.
 
 
 
