mgFargo (formerly known as Mgtrans)
is a utility that dumps your control file to source files having C-like statement syntax allowing the use of traditional text processing tools.
Latest News
9 December 2006 |
|
MgFargo perl-only version 0.804 |
|
This is a 9.4-only release. It may work with other versions of 9, but it definitely will not work with any version below 9. |
9 December 2006 |
|
MgFargo perl-only version 0.615 |
|
Fixes some 8.3 issues. Works better with text editors that recognize and color C code |
31 January 2005 |
|
Mgtrans perl-only version 0.611 |
|
Fixes a few 8.3 issues. |
09 November 2001 |
|
Mgtrans executable version 0.604 |
|
Fixes many 8.3 issues. This is a major revision. |
25 November 2000 |
|
Mgtrans executable version 0.589 |
|
Same as mgtrans-0589.pl script, but you don't need to install Perl or
Perlcrt.dll. |
25 November 2000 |
|
Mgtrans Wizard version 1.01 |
|
Supports the executable. Screen
Shot |
25 November 2000 |
|
Mgtrans.pl script version 0.589 |
|
Release to support the executable version of the script. |
Downloads
Recent Program Updates
- 12/9/2006 0.804 First and very raw release for version 9.4. Totally incompatible with anything earlier. Released for comments. I guess that makes it an Alpha release. It shouldn't bother your computer.
- 12/9/2006 0.615 Fixed a bunch of 8.3 issues and made it more likely that you'll see text coloring in a text editor.
- 10/26/01 0.604 Expand virtual display area to 32 from 21 after seeing
trunncation
- 05/17/01 0.603 Restore printing of static text in 5.xx forms. Lost
it with first 6xxversion.
- 05/17/01 0.602 Enable characters after Z for variable codes
- 04/15/01 0.601 Now report DB Cache value.
- 03/13/01 0.600 Fixes many 8.3 issues. This is a major revision. Display
the main task as it # appears in Magic, not the file version with lots of
dashes. Show form names in the layout section. Read the font table. Expand
font numbers. Add dot notation Task level info in Task hierarchy. Have option
to put item row/columns in forms first.
- 11/24/00 0.589 Update to work with Perl2exe.
- 11/24/00 0.588 Release to support the Wizard - mgtrans.ini can be
pathed.
- 11/13/00 0.587 Major 8.30 and Events functionality
improvement!
Report Return actions (PB_ACT = Pushbutton?).
Entire DIT_INFO section was not pulling in fields,
Now reads act_usr.eng to decode user actions and keys in Events and pushbutton
return actions.
- 11/03/00 0.586 Convert any 'xx'var references to @references as
is done in task/program calls.
- 11/02/00 0.585 Some Forms were unnamed. NAME of a Form may not directly
follow the brace, allow for some space in between.
Expressions for key of main file were not being calculated or printed.
- 09/25/00 0.584 Use .html extension and surround text in basic html
tags if flag in mgtrans.ini is set.
Remove '.' after file number in "Main File:".
- 05/22/00 0.583 Insert a line consisting of a non-text funny character
(a Control-A, octal 001) in line above 'Task Name:' so that it can be used
limit regex searches.
- Complete Change History
Want to be able to really understand your own code? Try this!
For VERSION 9.4 and possibly other version 9s.
- The zip file should have:
- mgFargo.ini
- mgFargo.pod
- readme9.txt
- example9.bat
- mgFargo-xxx.pl
- Get and install the latest version of ActivePerl from Activestate.com.
- Read example9.bat for info on how to set up your batch file from your folder layout.
- Unzip and put the mgFargo files where it works for you and still can be compatible with the batch file.
- Export your application in internal format.
- Run the batch file.
- The the directory. You should have a lot of new files.
- If it doesn't work. Its likely because you've used RTF on screens. Please tell me. I have a program to strip it out of the export.
For VERSION 8.3 and below
- Download mgtrans-0604.zip to get all files.
- If using any of the perl scripts, install Perl 5.6 (http://www.activestate.com).
- Then put the following in an empty directory (eg. c:\programs\mgtrans):
- mgtrans-xxx.pl if using the script,
- mgtrans-xxx.exe if using the EXE,
- mgtrans.ini ,
- mgtrans.pod (only required if you invoke the script incorrectly),
- Import the Mgtrans Wizard (wizard.std) into your Magic application (it creates no files, but uses your magic.ini for storage).
- Setup of your paths in its Preferences screen.
- Zoom on Go.
- Look in your Output folder.
How mgtrans output is best viewed
Click here to see the best way to view mgtrans output files.
Other Functionality - mgtrans-22.e and doc_ezr.eng
Click here to see epsilon macros which can convert 5.xx program document exports to a readable format -- no need to export the whole application.
Bug Report Summary. :-(
For VERSION 9.4 and possibly other version 9s.
- 12/9/2006 Doesn't handle RTF on form. Will probably hang if it encounters an initialized RTF text object. I have a workaround I have to add.
- 12/9/2006 Doesn't output screen or form info. I need to add this.
- 12/9/2006 Doesn't handle bound data objects. I need to add this.
- 12/9/2006 Doesn't identify a ctl a handler is connected to. I need to add this.
- ... and many more ...
For VERSION 8.3 and below
- 08/29/2000 A blank form confuses the form numbering. Workaround: Ensure you have no blank form descriptions.
- 08/22/2000 Block nesting is not always reported correctly.
- 06/29/2000 Combining statement execution conditions is not always valid.
- Bug Details
Sample Output of mgtrans
Now, about this script...
Yes, this is a Perl script. And by publishing this in script form, I'm letting it all hang out. Its not great Perl.
Its not elegant. It was written by a rank beginner. I think its easily modifiable. If I were doing it again I'd make better use of Perl's ability to remember where it is in a search.
And, maybe, because its not great Perl, its also not tricky Perl, so what's happening should be fairly obvious to most programmers.
Background
I created the mgtrans
utility so I could work with Magic PC applications in ways I had grown
accustomed with C projects. It allowed me to do the following:
I'm distributing this free because I think its useful, and maybe, if someone else likes it, they may pitch in with improving it. Check it out. I'll listen and maybe even implement your suggestions.
Mgtrans output helps you read the code. A good Magician needs a fabulous
memory. My memory's not what it used to be. Magic lets you
see your code, but only in snippets. Showing the expression for
the current line helps but there's nothing like seeing big chunks of code at once.
I've always found
the presentation very fragmented. And nothing about the organization
of the statements tells you anything about the operation of your code.
I expect blocks to be indented!
Allows you to search the code for anything. What if I want to know every
place a variable is set or used in a task, program, application, or which
program is emitting a particular warning message, or do I have blocks of
code common to more than one program? Since the output is just text, you can use any off-the-shelf tools to process it.
Assignment statements are always coded as: "variable <tab> =". Search on that and you won't get confused with other references to the variable.
Compare versions of the code. If my group releases a new version of a program
and now some function no longer works the same, I can compare the two versions and
find out immediately what was changed to cause the different behavior.
BTW, the ediff-buffers function in NT Emacs version 20 shows the differences color-coded word-by-word.
What does the generated output look like? I tried to make it look like C without curly braces. Download
and try it, or, look at this directory where I used version 0.587 to generate the source for
Magic 8.30's Monitor application. The fields area needs some work.
Here is the documentation for mgtrans in HTML.
I use the mgtrans output with either Lugaru Epsilon
or GNU Emacs text editors. These editors are wonderful
for searching and their grep functions support next-previous match commands,
where after you do a search, with one command you can go from match to
match with the editor automatically opening the file and positioning you
to the match. I have made a minor modification to Epsilon that puts
the name of the task on the buffer's status line (screen shot). I've also enabled C-style code
coloring (screen shot).
mgtrans is written in Perl. It was
developed on the standard version 5.04. I have currently run it on ActiveState's 5.006 Build 620.
I have also generated an executable from the script, mgtrans-0589.exe,
that runs without Perl installed. This was made possible by Perl2Exe.
If you want to use the script form of mgtrans or any of the other Perl scripts, you will need to install Perl. My recommendation is that you install ActiveState Perl
Copyright
The mgtrans program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License
as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
The mgtrans program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
Feedback
I'm open to comments and suggestions. I like to give credit where its due, so if you don't mind me mentioning your name when I implement your suggestion or bugfix, please indicate so.
I will only use someone's name if given permission.
Lugaru Epsilon
Lugaru
Software, Ltd. makes the Epsilon Programmer's Editor, an advanced EMACS-style
programmer's text editor for Windows, DOS, and OS/2.
Emacs
Emacs is available from a number of suppliers. The
most prolific is the Free Software Foundation, home of the GNU ("Gnu's
Not Unix") Project. They distribute GNU Emacs. On NT and Windows 95, the
most common version of Emacs is NT
Emacs, a direct port of GNU Emacs. For help with installing Emacs,
do an Altavista search using: nt
emacs
Links
Orange County Magic User Group
[
What's New |
Downloads |
How To |
Feedback |
Bugs |
Background |
Copyright
]
Last Updated: Nov 09 2001 ira@gershenhorn.com Copyright
© 1998,1999,2000,2001 Ira L. Gershenhorn. All rights reserved.