home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
database
/
indent.zip
/
INDENT.DOC
< prev
next >
Wrap
Text File
|
1993-05-11
|
54KB
|
1,508 lines
Indent!
Source Code
Indentation
for xBase
User's Guide
Copyright 1993
MH Software
(303) 438-9585
1006 W 104th Ave. #200
Northglenn, CO 80234
Table Of Contents
License Agreement ........................................3
Overview .................................................5
DOS Indent! Installation .................................5
Windows wIndent! Installation ............................6
How To Use Indent! (Quick Start) .........................6
How To Use Indent! (Detailed Instruction) ................6
/A, /B Spaces before and after key tokens. .........8
/C Additional Indentation for Do Case/Case
structures ..........................................8
/D Delete Extraneous Spaces And Tabs From the
Source File .........................................9
/F Additional Indentation for Functions and
Procedures ..........................................9
/G Add Action Diagram Symbols........................9
/I[T]n Continuation Line Indentation Control ........10
/K[L | U | P] Keyword Case Change .................11
/M[n1:n2:n3:n4] Align Comments ......................12
/O Output Messages to File .........................13
/R Remove Snap!/FoxDoc comment headers. ............13
/Sn Specify Indentation Characters ................13
/U Keyword Compression .............................14
/V[ L | U] Token Case Changes ......................15
/X Keyword Expansion ...............................15
@File List Processing ...............................15
#[R | I | ? ] Remove/Ignore/Set Directive Comment
Character ...........................................16
*#Directives ........................................16
*#LIST FILE <FileName> .........................16
*#LIST STRUCTURE <database name> ...............17
Parameter Passing ........................................17
Indent and SQL ...........................................19
Unions ..............................................19
Sub-Queries .........................................19
Indent and FoxPro ........................................20
Project, Screen, Menu, and Program Indentation ......20
Beautify Replacement ................................20
Running wIndent! From FoxProW .......................21
Common Questions and Answers .............................22
Technical Support ........................................22
Enhancement Requests .....................................23
Warnings and Messages: ...................................24
2
License Agreement
Grant of License
This license permits you to use the software (Indent!).
Ownership remains with MH Software.
You may install Indent! on one computer if you bought
the single-user version, or one file server if you purchased
the network license. The network license software may be
installed only on one server. The single user software must
fall under the same constraints as a book. You may not use
it in two locations at the same time. The only exception to
this shall be home use. License is hereby granted for
licensed users to install this software on a computer in
their normal work-place and one at their home. Home use is
construed as use for personal pleasure, or pursuing
regular, work-related tasks. If you wish to use this
software for independent software development at your home,
then you must purchase a separate license. This home-use
license will be automatically revoked upon your separation
from the purchasing company.
You may not reverse engineer, decompile, or disassemble
the software. You may not copy (except for backup
purposes), sell or otherwise distribute this software.
Copyright
The software is owned by MH Software and is protected
by United States copyright laws and international treaty
provisions.
Shareware
Indent! is shareware. This means that you may test
this software to determine if it fits your needs. If you
find it is useful to you, you must register this software by
filling out the enclosed registration form and returning it
with your payment. If you find this software is not useful
to you, you must remove this software from all computers you
installed it on. If you find this software is marginally
useful, but not worth the requested registration fee, please
contact technical support and let us try to make the product
work for you.
3
Limits of Liability
The Author and Publisher of this program have used
their best efforts in preparing this software, and the
accompanying documentation. The Author and Publisher make
no warranty of any kind, expressed or implied, with regard
to the programs or documentation contained in this product.
The Author and Publisher shall not be liable in any event
for incidental or consequential damages (including loss of
business profits, business interruption, loss of business
information, or any other loss) in connection with, or
arising out of the use of this program. Should a dispute
arise, this agreement shall be governed by the laws and
statutes of the state of Colorado, USA.
Defective Media
If within ninety (90) days of receipt of this software,
the distribution media is found to be defective, you may
receive replacement media for no charge. After 90 days
there will be a nominal shipping and handling fee.
Customer Remedies
MH Software's entire liability and your exclusive
remedy shall be, at MH Software's option, either (a) return
of the price paid for the software, or (b) repair or
replacement of defective media.
Trademarks
FoxPro, MSDOS, and Windows are registered trademarks of
Microsoft Corporation. dBase, dBase III and dBase IV are
registered trademarks of Borland International Inc. Clipper
and CA-Clipper are registered trademarks of Computer
Associates International, Inc.
4
Indent User's Guide
Overview
Indent! is an easy to use, yet powerful source code
indentation program for FoxPro, dBase, and Clipper. It
takes a standard xBase source code file, and formats it to
meet your requirements. Indent! has many advanced
formatting features that allow you to use it to format
source code to match your individual style. Indent! is
perfect for using on inherited code, or when modifying
source code. It can also be used to end style and
formatting arguments in multi-programmer shops. The
following pages give an explanation of Indent!, and its
options. It is our hope that you enjoy using this program,
and if you have any suggestions for improving it, that you
pass these suggestions along to us.
When you run Indent!, it takes the source code file you have
specified, and does the following things:
1. If there is a file with the same name, but an
extension of .BAK, that file is deleted.
2. The original file is renamed to <ProgramName>.BAK.
3. The new .BAK file is now opened, and the program is
read in, formatted, and written out to <ProgramName>.
4. Once the formatting is complete, the date-time
stamp from the original file is set on the newly
formatted file. In this way, you can re-format your
source code, without having to do a complete make or
re-compile.
5. Finally, Indent! will display a message telling you
how many lines of source code were indented.
DOS Indent! Installation
To install Indent!, please use the following checklist:
1. Copy Indent! and it's associated files into the desired
directory. Indent! may be installed in any directory you
wish. If you will always be running this program from an
Integrated Development Environment (IDE) such as FoxPro or
dBase, you can copy the Indent! files into your IDE
directory. Then, when you are in the IDE, you can use the
RUN or SHELL command to execute Indent.
5
2. If you have a registered version of Indent!, run the
REGISTER program. Enter the file name to register (Indent),
your serial number, and activation key. Once this
information is entered, you will be prompted to enter the
name of the owner of the software.
3. Add the directory to your DOS path if necessary. To use
Indent!, this directory must be in your DOS path. Refer to
the documentation accompanying your version of MS/DOS for
specific information on DOS paths.
Windows wIndent! Installation
Indent! comes with a Windows .EXE program called WIndent.
The Windows version of wIndent is called by INDFILE.APP, and
FoxProW to indent files from FoxPro for Windows. To install
wIndent, please use the following checklist.
1. To install wIndent!, copy the wIndent.EXE, wIndent.ICO
and wIndent.WRD files into your desired directory (FoxProW
directory is recommended).
2. From Program Manager choose File, New, Program Item and
select OK. Enter a description of wIndent. Next select
BROWSE to locate the wIndent! executable file. Next choose
the button labeled Change Icon. Select the BROWSE button
and use the Get File dialog to locate wIndent.ICO. Now
select OK, OK, and OK.
3. If you have a registered version of wIndent, run the
REGISTER program. Enter the file name to register
(wIndent), your serial number, and activation key. Once
this information is entered, you will be prompted to enter
the name of the owner of the software.
How To Use Indent! (Quick Start)
To use Indent!, from the DOS prompt type INDENT
<ProgramName>. ProgramName can be any DOS file name, and
can include the wild card characters * and ?. If the file
extension is not specified, .PRG is assumed.
To see the options that Indent! has, type INDENT, and press
enter. An abbreviated command list will be displayed. If
you pass invalid parameters to Indent!, the abbreviated
command list will be displayed.
How To Use Indent! (Detailed Instruction)
Indent! has a wealth of options that allow you to format
source code in almost any way that you desire. This section
gives a detailed explanation of the various formatting
6
options Indent! has. The general syntax is:
INDENT <FileSpec>[.<EXT>] | @<FileList> /<Option1><Option...>
FileSpec is any valid DOS file specification. If EXT is
omitted, a default extension of .PRG is assumed. EXT may
be any valid extension EXCEPT .BAK, and may not contain
wild-card characters. <FileList> is an optional list of
files to be processed by Indent! The list must be a plain
ASCII text file. The following examples demonstrate
different methods of specifying files:
Examples:
Indent all program files:
INDENT *
Indent all .SPR files:
INDENT *.SPR
Indent all programs starting with the letter A:
INDENT A*
For more information on MS/DOS wild-cards, and file
specifications, please refer to the documentation
accompanying your particular DOS version.
7
/A, /B Spaces before and after key tokens.
These two options allow you to specify character tokens that
must be followed by a space (/A), or preceded by a space
(/B). Some people prefer that all mathematical, and logical
operators be preceded by a space, and followed by a space
for ease of reading (i.e. C = A + B rather than C=A+B).
Using these options, you could specify what tokens should
have this kind of formatting. Tokens may NOT be alpha or
numeric characters. Characters to receive extra spaces
should be contained within ' marks (refer to example).
Example: Indent MyPrg /A'(+-~{}!*'B')+-~{}*!'
NOTE: Because of the constraints of the DOS operating system, a ~ must
be used for an = sign, { for <, and } for > when passing parameters for this
section. If you were to try using a > or <, DOS would think you were
trying to redirect input or output from the program. The restriction
on = signs applies when you use DOS environment variables to
pass options to Indent.
Warning: Because some symbols are used in more than
one context, this option may cause problems if
improperly used. An example of this would be the
asterisk (*). It can be used in the context of a DOS
file command, a Private command (i.e. Private all Like
L*) or as a multiplication operator. Because of this
kind of problem you should use care when selecting
tokens for /A and /B
/C Additional Indentation for Do Case/Case structures
This option provides extra indentation for DO CASE/CASE
structures. The default indentation for a DO CASE/CASE
structure would be:
DO CASE
CASE A
CASE B
CASE C
OTHERWISE
ENDCASE
specifying a /C parameter would cause the above code to be
indented as:
8
DO CASE
CASE A
CASE B
CASE C
OTHERWISE
ENDCASE
/D Delete Extraneous Spaces And Tabs From the Source File
Specifying /D causes Indent! to remove extra spaces and tabs
from your source file. For example, the line
A = B + C
would become:
A=B+C
This is NOT an inverse of /A or /B in that this option will
remove ALL (except those embedded in comments) extra spaces
or TABS from the program file. Any tabs embedded in the
file are converted to 1 space.
/F Additional Indentation for Functions and Procedures
Specifying /F causes procedures and functions to have
additional indentation. For example:
Function FOO
Parameters A, B, C
?a,b,c
Return A*B*C
would be indented as:
Function Foo
Parameters A, B, C
?a,b,c
Return A*B*C
Note: This extra level of indentation will apply
until the first non-nested return statement is found.
For example, if you have a procedure, with no return
statement, all lines up until the next function, or
procedure will have additional indentation. This
includes comments. It is therefore recommended, that
each procedure end with an explicit return.
/G Add Action Diagram Symbols
Specifying /G has Indent! format your source code using
9
action diagram symbols. This kind of graphical outlining of
source code can be extremely handy in modifying programs, or
in examining programs for logic flaws. Calling Indent!
without the /G command will automatically remove the
structure graphics. SQL SELECT commands will not have
structural graphic characters. They will be treated as any
other multi-line command.
/I[T]n Continuation Line Indentation Control
This option allows you to control the amount of extra
indentation that is applied to continuation lines.
Continuation lines are those lines where the preceding line
ended in a semicolon. By default, continuation lines will
receive an extra three spaces of indentation. For example,
the following command:
select userdata
browse fields a,b,c;
for a>10;
window MyWin;
title "User Data";
NoModify
close databases
will automatically be indented as:
select userdata
browse fields a,b,c,;
for a>10;
window MyWin;
title "User Data";
NoModify
close databases
To specify using 2 spaces, you would issue the command:
INDENT MyProg /I2
To specify indentation using a tab character, issue the
command:
INDENT MyProg /IT1
If you desire to have no additional indentation for
continuation lines, use:
INDENT MyProg /I0
Hint: If you have a case where you want several
function parameters to be aligned, or logical operators
aligned, you can format your code like this:
10
=MsgWin(;
"Text Line 1"+;
"Text Line 2"+;
"Text Line 3")
Or,
IF ;
A>B .and. ;
B>C .and. ;
C<D
/K[L | U | P] Keyword Case Change
When you specify this option, the list of key words
contained in the file INDENT.WRD is read into memory. As
each line of your program file is processed, a matching
process is performed. Any words from the program file that
are found in the keyword file can be set to UPPER case,
LOWER case, or PROPER case. Proper case means that the key
word will have its case adjusted to be the same as the
example in the file INDENT.WRD. The file INDENT.WRD must be
located in the same directory as INDENT.EXE. For
instructions on how to modify the INDENT.WRD to match your
specific xBase compiler, refer to the instructions contained
in the INDENT.WRD file.
Examples:
To set all keywords in a file to lower case:
INDENT MyProg /KL
To set all keywords in a file to upper case:
INDENT MyProg /KU
To set all keywords in a file to the same case as the words
contained in the file INDENT.WRD:
INDENT MyProg /KP
Note: If this option is selected, the program will
display a warning message for every instance where a
key word from the file is used as an LValue in the
program. An LValue is a variable or identifier that is
on the left side of an assignment operator (= sign).
For example, if you use the word BROWSE as a variable,
then you will be warned that the keyword BROWSE is used
as a variable, and the line number will be displayed.
11
/M[n1:n2:n3:n4] Align Comments
This option allows you to specify that comments be aligned.
This only affects comments that are introduced with &&
characters. Comments beginning with * are not affected by
this option. For example, the program:
a=b*c && assign a the product of b and c
&& for use by another section
c=a+b
when indented with /M specified would look like this:
a=b*c && assign a the product of b and c
&& for use by another section
c=a+b
There are four parameters that may be used with this option.
The first, n1, tells the Indent! Program how many characters
a TAB is displayed with by your editor. This allows Indent!
to have correct alignment even on lines that have embedded
tabs. The default value if this parameter is not specified
is 1 tab = 4 spaces.
The second parameter is the starting column to have comments
align on. The default starting column for alignment is 33,
but you may specify any column you desire.
If the comment cannot be aligned at the default starting
position, it is aligned to default+n3, default+2*n3, etc.
The default value for n3 is 8. For example, if you specify
a starting column of 35, but the code extends past that
point, then the comment will be aligned on column 43 if
possible.
If there is a gap of more than n4 (default 16) between the
natural placement of a comment, and the previous comment,
then the alignment column will reset to n2.
Examples
Align comments, with a text editor that shows 3 spaces
per tab
Indent MyProg /M3
Align comments with a text editor that shows 4 spaces
per tab, starting on column 40, spacing increment value of
6, and a reset gap width of 20.
Indent MyProg /M4:40:6:20
Subsequent comments will align underneath each other,
until the difference in the default alignment is greater
12
than n4, or a new procedure or function is encountered.
Hint: You may wish to use asterisks to introduce
comments that will be left justified, while reserving
&& to introduce comments that are either on the same
line as a piece of code, or are a continuation of a
comment for such a line.
/O Output Messages to File
/O forces output messages to be sent to the specified file.
This can be useful if you wish to capture all warnings for
later examination. The output file can also be the DOS NUL
device, or a printer port (i.e. LPT1, PRN, etc.).
Examples:
INDENT /O=INDENT.OUT *.PRG /RFC
INDENT /O=LPT1 *.PRG /RFC
Notes: If you wish to capture any diagnostic messages
concerning parameters, /O must be the first parameter
listed. The file specified in the parameter is
overwritten each time. If you wish to capture several
sessions, you should save each file, or use the @File
List option to process all files in one session.
/R Remove Snap!/FoxDoc comment headers.
The documentation programs Snap! and FoxDoc automatically
put procedure and function headers in source code files.
This option removes those automatically generated headers.
All comment lines that start with *! or *: will be removed
from the program. Standard comment lines are retained.
Example:
INDENT MyProg /R
Note: If you specify /R, and Snap!/FoxDoc comments are
removed, then the time stamp on the file will be set to
the current date/time. This is done so that the file
will be re-compiled on the next build. If this were
not done, source-level debuggers would not work
properly.
/Sn Specify Indentation Characters
By default, Indent! uses a TAB as the indentation character.
You can tell Indent! to uses spaces, and specify the number
13
of spaces to use for indentation.
Examples:
This example sets the indentation string to 3 spaces.
INDENT MyProg /S3
The following example demonstrates using 0 spaces, or
de-indenting a program:
INDENT MyProg /S0
/U Keyword Compression
Indent! allows you to specify that all keywords be
compressed. For example, PROCEDURE would become PROC,
FUNCTION would become FUNC, etc. When abbreviating
keywords, Indent! tries to determine how many letters it may
reduce a word by and yet maintain a unique word as contained
in the key file. For example, when abbreviating NOCLOSE,
Indent! will start with 4 letters, but increase the number
to 5 to avoid conflict with NOCLEAR.
Warning: This is a powerful and dangerous feature. I
cannot stress strongly enough the care you should use
with this option. Please take the time out to read the
case list below before using this option. You may wish
to use Indent! with /K before using this feature. /K
will let you know of any instances where keywords have
been used as lValues in a statement. This can be a
good first step before using this part. Always make a
backup of affected files before using this option. If
you have not wisely chosen your keywords, this feature
can render your program useless. Below are some
examples of how /U may corrupt a file.
You have two variables that are different abbreviations
of the same keyword. An example of this error would be
prefer and preference. Once abbreviated these two
variables will become the same, and upon expansion they
would remain the same.
Another area of consideration is field names. The
program Genscrn.PRG that comes with FoxPro references
several database fields that have the same name as many
keywords. Running this program after using /U will
cause it to fail because the field names referenced
will no longer be correct.
If you have a procedure file named BUILD in your
application and you use /U, All calls to BUILD will
become calls to BUIL. At run-time (or at compile time
14
if you are lucky) you will have a file not found error.
/V[ L | U] Token Case Changes
/V allows you to specify that all tokens (variable names,
procedure and function names, file aliases) should be forced
to upper, or lower case. This option can only be used in
conjunction with /K.
Examples:
Force all tokens to Upper Case:
INDENT MyProg /KLVU
Force all tokens to Lower Case:
INDENT MyProg /KUVL
/X Keyword Expansion
Indent! allows you to specify that all abbreviated keywords
be expanded. For example, PROC would become PROCEDURE, FUNC
would become FUNCTION, etc. When expanding keywords Indent!
tries to determine how far it may expand a keyword before
possibly introducing undesirable meanings. For example, the
abbreviation SELE would be expanded to SELECT, and no
further. This is because there are two keywords that start
with SELE, SELECT and SELECTION. The furthest that SELE can
be expanded without causing problems is SELECT. This
situation will apply in any cases where there are (almost)
duplicate entries in the keyword table. Some other examples
would be WINDOW and WINDOWS, SHADOW and SHADOWS.
Warning: Please read the complete warning in the
section on keyword compression (/U). Keyword expansion
and compression can cause severe problems, and should
be done with great caution!
@File List Processing
Indent! allows you to pass the name of a text file as a
parameter. This text file is read, and the files listed in
it are processed. List file names may contain any valid
file specification as discussed above. An example list file
is given below.
Examples:
INDENT @test.lst
15
where the file TEST.LST contains
mytest.prg
\lib\*.prg
*.spr
*.mpr
#[R | I | ? ] Remove/Ignore/Set Directive Comment Character
Each time Indent! sees an Indent! directive in a line of
code, by default it will expand that directive into comment
lines. The /# parameter affects how these directives are
handled. A summary of the commands is listed below:
/#I Ignore directives.
/#R Remove existing directive comment lines and ignore
directive lines.
/#? Set the character used by Indent! for comment
introduction. By default directive comments will start
with *|. You may specify another character by passing
as a paratemeter /#<Character>. When removing
directive comments, Indent! will remove all comments
starting with an asterisk + the character you specify.
The character specified may not be a digit, or a
letter.
Hint: You can remove all of the directive commands from
your program by running Indent! with the parameter /##.
*#Directives
Indent! supports additional functionality through the use of
directives. These directives are placed in your program as
comments, and are expanded when Indent! formats your code.
The information that Indent! generates are placed in your
program as comments. Currently supported directives are
described in detail below.
*#LIST FILE <FileName>
Using this directive you can specify that a file be
read and placed into your code as comments. An
example of this would be a copyright listing. You
could place the copyright text in one file, and then
in your code reference it. This command does not
support wild-cards.
16
*#LIST STRUCTURE <database name>
Using this directive you can have Indent! place the
structure of your database files inside your program
as comments. The database name, type, last update,
record size and count, and each field description
along with descriptions of compound structural
indexes (CDX or MDX) will automatically be inserted
into your code. Database names may include wild-
card characters. An example of the output is shown
below:
Source code before:
*#List structure p*
Source code after Indent!
*#List structure p*
*|************************************************************
*| Database Name : PHASE1.DBF
*| Database Type : xBase Standard
*| Last Updated : 93/04/09
*| Record Size : 251 Record Count : 4896
*| File Size : 1228962
*|
*| Field Field Name Type Width Decimals
*|
*| 1 LINE Character 250 0
*|
*|**********************************************************
Each time you run Indent!, it will automatically
remove the existing comment lines, and insert new
comment lines containing the specified database
structures. For more information on Indent!
directives, refer to the section on /#.
Note: Each time you run Indent! and macro comments
are removed or added, the date/time stamp of the
file will not be preserved.
Parameter Passing
Parameters may be combined together, or passed individually
on the command line. For example,
INDENT MyProg /R /F /C
is equivalent to
17
INDENT MyProg /RFC, or INDENT /RFC MyProg
A dash (-) can be used rather than a forward slash (/) to
introduce switches.
If invalid command line parameters are passed, the program
will display an abbreviated command list.
You may also set the parameters for Indent! by using a DOS
environment variable. Rather than passing the parameters
each time you use Indent!, you could set an environment
variable in your AUTOEXEC.BAT file, and the parameters would
be used each time you call Indent.
Example:
from the DOS prompt, type:
SET INDENT=/RFCI2S2
Now, each time you run Indent!, it will automatically have
the parameters set to Remove Snap!/FoxDoc Headers, Provide
extra indentation for Function, Procedures, and DoCase/Case
Structures, Continuation lines will receive two additional
spaces for indentation, and 2 spaces will be used for
standard indentation. To indent a program with these
options, just run Indent! with the file name.
NOTE: If you are setting the Indent environment
variable from a batch file, and you are using the /A,
or /B options, and you wish to specify the % (modulus)
operator for either section, then when you set the DOS
Environment variable, you must use the following
syntax:
SET INDENT=/A'%%+-'
Once set environment variables will always be active, and
will override command line parameters. If you are using
wIndent!, then you must change the environment variable name
to WINDENT.
If you don't wish to use environment variables, you can
create a batch file having the parameters you want to call
Indent! with. For example, the following batch file could
be used to always call Indent! with FCS2 parameters:
INDENT %1 /FCS2 %2 %3 %4 %5
You can create this batch file, and name it something
besides Indent, ID, for example. Then when you wish to call
18
Indent!, from the command line you could type ID <FileName>.
Hint: In my work I use a batch file to format a file
with action diagram symbols (/G), send it to the
printer, and then immediately remove the graphics.
This makes it very easy to print program files for
review and modification.
Indent and SQL
Indent! will automatically handle Structured Query Language
(SQL) SELECT statements. Because SQL, unlike xBase does
not have defined structural command endings, there are some
special caveats about formatting SQL code. If you are using
sub-queries or unions, you should read this section.
Unions
A query with a union clause should be structured like
the following example:
Select ...;
from ...;
into ...;
where ...;
union;
select ...;
from ...;
where...;
Not Like
Select ...;
from ...;
into ...;
where ...;
union select ...;
from ...;
where...;
Sub-Queries
A query with a sub-query should be structured like the
following example:
Select ...;
from ...;
into ...;
where <expr>=<expr> and;
<expr> not in (select <expr> from <table>);
order by ...;
19
group by ...
Not Like
Select ...;
from ...;
into ...;
where <expr>=<expr> and;
<expr> not in (;
select <expr> from <table>);
order by...
group by...
The key point in sub-queries is that the SELECT
statement for the sub-query not start a line, and that the
sub-query be contained entirely on one line.
Indent and FoxPro
Project, Screen, Menu, and Program Indentation
Indent! comes with two FoxPro .APP files. The FoxPro 2.0
file is named IDFILE.APP, and the FoxPro 2.5 version is
called INDFILE.APP. These files can be used to indent
entire projects, screens (including all snippets), menus,
and program files. To execute these programs type DO
<FileName> from the command window. A file open dialog will
appear and you can select the file to indent. Once you have
selected a file, an options menu will appear to allow you to
set the controls that Indent! should use during processing.
Selections, once made, will be saved in your FoxUser
database for use the next time. After you have made your
formatting selections, the program will call Indent! to
process your files. It is recommended that you install
these files in a directory on your hard-drive, and add that
directory to your FoxPro path using the CONFIG.FP<W> file.
For information on CONFIG.FP<W> refer to the FoxPro Help
file. Once this is done, you can execute the programs from
any directory you may be working in.
Beautify Replacement
FoxPro 2.5 for Windows comes with a built in beautify
feature. You can replace Microsoft's beautify program by
adding the following line to your CONFIG.FPW file.
_BEAUTIFY='INDFILE.APP'
And copy the file INDFILE.APP into your FoxProW directory.
Now when you select beautify from the main menu, INDFILE.APP
20
will be called allowing you to use Indent!'s formatting
features.
Running wIndent! From FoxProW
If you have installed wIndent!, you can run it directly from
the command window of FoxProW. To do this type RUN /N
wIndent <FileName> /<Options>.
21
Common Questions and Answers
Q: When I run the FoxPro .APP files, I get a series of BAD
COMMAND OR FILENAME messages, and my snippets and programs
are not indented.
A: You must ensure that INDENT.EXE and INDENT.WRD are in
your DOS path when executing these programs.
Q: When I run Indent!, my file is totally mangled.
A: You must check to ensure that your file editor saves
your code with line-feeds. On the FoxPro editor, Select
Edit/Preferences/Save Text With Line Feeds. Then set this
so that it is the default for all your files.
Q: Four letter abbreviations of keywords are not having
their case changed.
A: The INDENT.WRD file that comes with the program does not
have four letter word abbreviations. The program will also
not check to see that a word might be an abbreviation. You
have two choices: (a) Add the four letter abbreviation
keywords to the INDENT.WRD file, or (b) Use the /X option
to expand keyword abbreviations. Keep in mind that if you
do add four letter abbreviations, /U and /X will be disabled
for those keywords (refer to instructions on /U & /X).
Q: When I run Indent! with the /V option, my tokens
(variable names, field names, function & procedure names)
are not modified.
A: You can only use the /V option in conjunction with /K.
Check also to see that Indent can locate the INDENT.WRD
file. It should be located in the same directory as
INDENT.EXE.
Q: When I use *#List Structure macro command, sometimes it
works, other times I get comments saying UNABLE TO OPEN
DATABASE <NAME>.
A: Indent! tries to open specified databases in
Shared/Read-Only mode. If you or another person have the
database open exclusively, then Indent! will not be able to
open and read the file.
Technical Support
Every effort has been made to ensure this software is free
of defects. If you find something you think is a defect
please contact us. We will work with you to fix any bugs
22
you may encounter. A bug is an instance where the program
does not work according to the documentation. If you find a
bug in this program we will make every effort to fix the
problem and provide you with an updated program.
You may contact technical support by calling (303) 438-9585,
via Compuserve mail ID 73237,1665, or via mail at:
MH Software
1006 W 104th Ave. #200
Northglenn, CO 80234
Enhancement Requests
We welcome your requests for enhancements. MH Software is
dedicated to providing the finest xBase enhancement tools
available. We need your input to let us know how we can
improve our products. Please provide your daytime telephone
number in the event that we need to contact you for
clarification. Please forward all requests for enhancements
to Compuserve Mail ID 73237,1665 or mail them to:
MH Software
1006 W 104th Ave. #200
Northglenn, CO 80234
23
Warnings and Messages:
No files matching <FileSpec> found!
Indent! was unable to find any files matching the file
specification passed. If you are running Indent! from an
integrated development environment (IDE), and shelling out
to run Indent!, ensure that the DOS default directory is the
same as the default directory for the IDE.
Error opening list file: ???
You ran Indent! with the list file option (@) but Indent!
was unable to find the list file to process.
Invalid file extension .???. Extension may not be .BAK or
contain DOS wildcard characters ? or *.
The file extension passed was either .BAK, or contained wild
cards. Indent! cannot properly handle extensions like this.
If you have multiple extensions that you must indent, it is
recommended that you create a batch file calling Indent! for
each unique extension.
Warning: Text statement started on line nnn. No matching
ENDTEXT found!
Indent! will not Indent! source contained between the key
words TEXT and ENDTEXT. If you do not have a corresponding
ENDTEXT statement, this message will appear, and alert you.
This message can also be caused by using the keyword TEXT as
a variable identifier. For a complete description of
TEXT/ENDTEXT, please refer to your xBase language reference
manual.
Program Assertion Failure, ???. Program halted!
Error occurred on line nnn.
If you get this error, DON'T PANIC. Remember, your original
source code program is available in the .BAK file. Before
performing any other steps when receiving this error, copy
the .BAK file to your original file name. When you receive
this error, an internal error or memory allocation error has
occurred. If you are running this program from inside an
Integrated Development Environment (IDE) ensure that Indent!
has at least 384K of free memory to execute. If you
continue to get this error, please copy down the exact
message, and contact technical support for problem
resolution.
Keyword ??? used as a variable on line nnn.
24
When the /K option is specified, the program checks
automatically to see if any keyword found is used as an
LValue. An LValue is a variable identifier that is used on
the left hand of an assignment operator (= sign). If the
keyword is being used as an LValue, the warning message is
displayed. It is recommended that you not use keywords as
variable identifiers. This can cause very strange and
difficult to trace bugs. Additionally, using keywords as
variable identifiers can cause Indent! to become confused
about how your program is structured, and provide incorrect
indentation.
Cannot open key word input file INDENT.WRD.
The /K, /X, or /U options have been selected, but Indent! is
unable to find the keyword file. The INDENT.WRD file should
be located in the same directory that INDENT.EXE is located.
If you get this error, program execution will continue as
normal, but the /K, /V, /X and /U parameters will be
ignored.
Error renaming file: ???.
Something prevented Indent! from renaming the input file to
a file with an extension of .BAK. It is possible the
original .BAK file has its attributes set to read-only, or
that the original file has been set to be read-only. If you
are operating on a network, it is also possible that someone
else on the network has that file open, and is editing it.
If this is the case, you will not be able to indent the file
until that person has completed their modifications, and
closed the file. Similarly if you have the file open in an
edit window, of an Integrated Development Environment, then
you will not be able to indent the file until you close it.
Error opening file: ???.
Something has prevented Indent! from opening the input file.
Check to ensure that the FILES= line in your CONFIG.SYS file
is set to an adequate level. If you are using Novell
NetWare, check to ensure the FILE HANDLES line in your
SHELL.CFG file is set to an adequate number.
25