NAME

mgtrans.pl - Translate Magic PC v5.xx-v8.xx exported internal format files to a more readable and searchable format.


Features


SYNOPSIS

mgtrans [-hvnuf] [-s N] [-e N] [-p progist] [-d InternalFileExport] InternalProgramExport

InternalProgramExport output of Magic in internal format.

For Detailed Help type: mgtrans -h


ARGUMENTS

-p progList
Unnecessary if you are using an application export. Optional if you are converting one program and don't care that none of the called programs are identified. The lines in the list have the same format as the Magic Document Export of Programs Table of Contents. Alternatively, it only requires lines of the format:

       Program Name dd/dd dd:dd

There can be any text after the dd/dd and before the dd:dd or after the dd:dd, where 'd' is a digit (0-9). Formfeed characters starting off lines will not be considered part of the program name.

-d InternalFileExport
Unnecessary if you are using an application export. Optional if you are converting one program and don't care that none of the real fields are identified.

-s
Range Start. For reporting on part of an application export.

-e
Range End. For reporting on part of an application export.

-v
Verbose mode. Gives progress report.

-f
Indicates to use database file name prefixes for real fields. The default is not to use them.

-u
Indicates to 'uniquify' variable names. Default is to 'uniquify'.

-n
Number the output files.

-m
Get this manual page.

Alternative to command parameters
In the same directory as the internal program export file, create an mgtrans.ini file having lines such as these:

   Verbose            = [0|1]
   numberFiles        = [0|1]
   uniquifyVars       = [0|1]
   useDfNamePrefixes  = [0|1]
   startProgram       = 999
   endProgram         = 999
   proglist           = FileSpec
   internalFileExport = FileSpec

These properties correspond to the options v, n, u, f, s, e, p, and d respectively.

For logically valued fields, the value of '1' enables the property and '0' disables. Other fields take numeric or text arguments.


EXAMPLES

Sample call to convert an entire application using mgtrans.ini
mgtrans /FACT/FACTRUN/FAP

Sample call to convert an entire application not using mgtrans.ini
mgtrans -v -n -u -f /FACT/FACTRUN/FAP


BUGS

 glob seems broken for NT, so we need full, not relative, pathnames.
 glob now fails on AIX.
 Fails when application has no data files defined.  Looks for external data dictionary.


Planned Enhancements

 Defaults exclusion option.  Not include task and flow parameters that are defaults.
 Specify the Magic.ini to be used in the mgtrans.ini file or on the command line.
 Clean up formatting of display blocks.
 When looking for brackets, strip record first of all strings.
 Add documenting of Reports - currently skipping RPR=\{ records.
 Gotcha in FS 117 Debug LPR (LineView)
 Read MAGIC.INI to get '.eng' files. Allow it to be passed in on command line.
 Read .eng files for translation of Actions and Keyboard codes. Allow these to be passed in also.
 Read types fields . Allow passing in.
 Add GNU License or Shareware license text.


HISTORY

 09/18/98 Created from Epsilon reformatter
 10/02/98 Added support for incremental update mode.
 10/05/98 Bypass glob if it returns null.  On NT it seems to be broken. 
          Maybe I am missing a command line parameter. Whatever?
 10/05/98 Delete '=' signs following close paren in regexes. Worked in Unix, Not in NT.
 10/14/98 Added uniquify and datafile name prepending.
 10/15/98 Added pod suitable for text,html or manpage output.


AUTHOR

Ira Gershenhorn <iragershenhorn@mindspring.com>