|
|
Ave2HTML.exeThis utility converts Avenue scripts into nicely indented text with comments highlighted. It has two principal uses: as a "pretty printer" that automatically indents Avenue scripts and as a means to communicate Avenue scripts on web pages. Readers have also noted that it can be useful for reformatting unfamiliar scripts to enhance their readability. Here is a side-by-side comparison of an input script and the output html:
AvailabilityAve2HTML is free. Download it from ESRI's ArcScripts pages. InstallationAve2HTML is a command-line utility. Just download the file (an exe file) into any directory in your system path or into the directory where you want to use it. UsageAt the command prompt type
where
Examples
This creates a pretty html version of the contents of sample.ave. The comments will be cyan and the indents will be two spaces.
The output is named "test.htm". The comment color is pale red (as in the example below) and the indents are four spaces.
The output will appear on the screen as html source text.
The computer will sit and wait for you to type valid Avenue input at the keyboard. Output will appear on the screen.
All files in the current directory with "ave" extensions will be processed. The output will be concatenated into all.htm. Interaction and Error HandlingSummary information will be displayed on the screen while the program is running, as in this example:
The screen output consists of the -font and -indent values used followed by the names of the files processed, one per line. The number of tokens processed is a measure of total file size. Any errors encountered will be listed on the screen as well:
Here an error was encountered on line 43 of test.ave. After issuing a description of the problem, the program emits the remaining portion of the line causing the error. The caret symbol (^) points to the character being processed when the error was discovered. All further processing stops, so only one error at a time can be discovered this way: there may still be more errors in the input files. Limitations
There are some work-arounds:.
The examples given here were tested in the command window for Windows NT 4.0. Other versions of Windows and DOS may have slightly different features (for instance, long file names will not be a problem on older versions of DOS) but the work-arounds described here will still be possible.
Solution: It is simple to edit the output. The output has been structured to make it easy to extract groups of lines, to add additional font and background information, and so on. The -indent and -font options spare you from having to do global search-and-replace operations. Special Features and UsesIf all you want is the reformatted text, without the HTML markup, then run Ave2HTML, point your browser at it, and copy it from your browser into an ArcView Script Editor document. Ave2HTML executes rapidly: it can process tens to hundreds of input files per second. It is not fooled by strange or complex scripts. If you have a script for doing any kind of processing of Avenue scripts and it can handle the original below without error, then you can be proud.
Modification History28 January 2002: The "Limitations" section was added in response to useful comments forwarded by Scott Kutz. 25 January 2002: This page was created. |
ColorRamp, Memorized Calculations, Rotate, Sample, and Tissot are trademarks of Quantitative Decisions. All other products mentioned are registered trademarks or trademarks of their respective companies.
Questions or problems regarding this web site should be directed to [email protected].
|