Copyright: © 2001 ... Ladislav Sobr


What is Pascal Indent

Pascal Indent is a program for formatting of source codes of Pascal and Delphi according to predefined rules which can be widely configured. Its main features are often called Indent, Pretty-printer (Beautifier) and Format Convertor. Format Convertor converts source code to text formats such as RTF, HTML, XML or TEX. Pascal Indent can be run in two roles: the first one is Indent and Pretty-printer, the second one is Format Convertor. Command line version can be used almost in any system with C compiler (MSDOS, Windows, Unix-based systems, ...). GUI is now written in Delphi - for Microsoft Windows.

Indent and Pretty-printer

Indent provides correct indenting of lines in source code according to syntactical position in the code. Pretty-printer (or Beautifier) does a formatting of a single line - it primarily takes care of spaces between tokens and correct case of letters.

Both these features have many common things, so they are implemented as one functionality under name Indent. Indent also deals with comments and splitting and joining of lines.

Format Convertor

Format Convetor performs conversion of the Pascal source code into some text format which uses tags(marks) to express the format of text.

See also

Main features,

Introduction to Indent,

Introduction to Format Convertor,

Introduction to Graphic User Interface


Credits

Author:	Ladislav Sobr (sobr@email.cz)

When:	main core: December 1999 - April 2000 ; GUI: September 2000 - March 2001

Where(core):	Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic

Why(core):	program for credits from C/C++ lectures

Please excuse the level of English of this documentation. There are surely a lot of grammatical and stylistic mistakes or typing errors in the text. English is not my home language and I had limited time for translation from Czech. Programmer's documentation (including all comments in source code) is still only in Czech. Thank you.


Versions

This is user documentation for these versions of programs:

Pascal Indent (core) 	version 1.1.0

Pascal Indent for Windows (GUI) 	version 1.0


Main Features

Indent

•	formatting of source codes of Borland Pascal 7 and Inprise Delphi 5 (maybe also lower versions)

•	many styles of formatting and indenting of BEGIN...END blocks, commands like IF...THEN... (WHILE...DO..., FOR...DO... etc.), CASE...OF...END blocks, RECORD structures, objects (OBJECT), classes (CLASS), declarations of constants (CONST block), types (TYPE block) and variables (VAR block), configurable placement of labels, formatting of constant structures (arrays, records) etc.

•	mostly configurable sizes of indentations according to situation (what is to be indented)

•	two right limits of lines (where text is wrapped)

•	a possibility of automatic splitting and joining of strings

•	several styles for formatting of comments

•	adjustable enforcement and supression of spaces around tokens ; user can create groups of tokens with the same behaviour

•	changes of case of letters according to list of correct forms or according to first occurence of token in source code

•	possible preferred EOL insertion after tokens from user list

•	possible suspension and restoration of formatting (using special comment)

•	and other details

What Indent cannot do:

•	it cannot cope with conditional compilation directives if the syntactical structure of Pascal is corrupted when they are ignored

•	it cannot cope with included files (directive $L ... {$L name_of_file} )

•	it cannot format assembler well - assembler is left unformatted

•	it doesn't format (arranging, splitting, reordering etc.) interior of comments - it is an intention, because this functionality would make it sometimes problematic to work with formatted code - see Formatting of Comments)

Format Convertor

•	it can handle with almost any dialect or version of Pascal or Delphi

•	it inserts texts (typically some tags) before and after tokens; user can create groups of tokens with the same behaviour

•	a possibility of overwriting of some texts by another ones (e.g. in HTML "is greater then" character  >  must be replaced by  &gt  etc.)

•	a possibility of removing superfluous pairs of tags (e.g. in HTML it can delete a sequence  </B><B> )

What Format Convertor cannot do:

•	it cannot cope with a Pascal dialect which uses for assembler something else then ASM...END block


Usage of Command Line Version

All configuration is done in the configuration file. Then you just run Pascal Indent from command line.

Indent

pasind  [ -c configuration_file ]  input_file  output_file

Format Convertor

pasind  -f [ -c configuration_file ]  input_file  output_file

Printout of default configuration

pasind  -g output_configutarion_file

Remarks:

•	When the specification of configuration file is omitted ( -c option is missing), then Pascal Indent looks for  pasind.cfg  as configuration file (in current directory, in DOS and Windows then also in the directory, where  pasind.exe  is.)

•	As input or output file you can use dash (-) for standard input or standard output. For example command      pasind program.pas -    will format file  program.pas  and the result will be written to the standard output.


General Settings

These configuration variables are common for Indent as well as for Convertor :

•	DELPHI  - determines, whether the input source is a program in Pascal or Delphi

•	INPUT TAB SIZE  - size of tabulator for input source

•	SPACES TO TABS  - determines, whether groups of spaces will be replaced by tabulators

•	OUTPUT TAB SIZE  - size of tabulator for output source

•	MAX LENGTH OF LINE  - maximal count of characters on one line of input source


Introduction to Indent

Indent is a part of program Pascal Indent (for Windows) which performs:

•	formatting a source code - primarily indenting

•	inserting and removing spaces between tokens

•	changing case of letters in tokens

•	ends of lines

General variables:

INDSIZE GENERAL  - determines default setting for all sizes of indentation


BEGIN...END type

BEGIN...END type represents these commands:

BEGIN...END

REPEAT...UNTIL

TRY...EXCEPT...END	(Delphi)

TRY...FINALLY...END	(Delphi)

The settings for BEGIN...END type are also used for blocks:

INITIALIZATION	(Delphi)

FINALIZATION	(Delphi)

Formatting

BEGIN...END type is formatted according to setting of variables:

•	IND BEFORE BEGIN  - indentation before BEGIN

•	IND AFTER BEGIN  - end of line and indentation after BEGIN (it means indentation of commands in BEGIN...END block)

•	IND AFTER THEN BEGIN  - end of line and indentation after THEN if BEGIN follows

•	IND AFTER ELSE BEGIN  - end of line and indentation after ELSE if BEGIN follows

•	IND IN CASE BEGIN  - end of line after label in CASE...OF block if BEGIN follows

Sizes of indentations follow these rules:

•	INDSIZE BEFORE BEGIN  - size of indentation before BEGIN

•	INDSIZE AFTER BEGIN  - size of indentation after BEGIN (it means size indentation of commands in BEGIN...END block)

•	INDSIZE AFTER THEN BEGIN  - size of indentation after THEN, if BEGIN follows

•	INDSIZE AFTER ELSE BEGIN  - size of indentation after ELSE, if BEGIN follows

The setting of variables influences the placement of keywords BEGIN, END etc. as well as the formatting inside BEGIN...END blocks.


IF...THEN type

IF...THEN type represents these commands:

IF...THEN

FOR...DO

WHILE...DO

WHITH...DO

Formatting

IF...THEN type is formatted according to setting of variables:

•	IND BEFORE THEN  - end of line before THEN

•	IND AFTER THEN NORM  - end of line and indentation after THEN if neither BEGIN, IF nor CASE follows

•	IND AFTER THEN BEGIN  - end of line and indentation after THEN if BEGIN follows

•	IND AFTER THEN IF  - end of line and indentation after THEN if either IF or CASE follows

Sizes of indentations follow these rules:

•	INDSIZE AFTER THEN NORM  - size of indentation after THEN if neither BEGIN, IF nor CASE follows

•	INDSIZE AFTER THEN BEGIN  - size of indentation after THEN if BEGIN follows

•	INDSIZE AFTER THEN IF  - size of indentation after THEN if either IF or CASE follows


ELSE

Behaviour after ELSE is controlled by setting of these variables:

•	IND AFTER ELSE NORM  - end of line and indentation after ELSE if neither BEGIN, IF nor CASE follows

•	IND AFTER ELSE BEGIN  - end of line and indentation after ELSE if BEGIN follows

•	IND AFTER ELSE IF  - end of line and indentation after ELSE if either IF or CASE follows

Sizes of indentations follows these rules:

•	INDSIZE AFTER ELSE NORM  - size of indentation after ELSE if neither BEGIN, IF nor CASE follows

•	INDSIZE AFTER ELSE BEGIN  - size of indentation after ELSE if BEGIN follows

•	INDSIZE AFTER ELSE IF  - size of indentation after ELSE if either IF or CASE follows

Remark: When the value of some of these variables is not explicitly set than ELSE behaves in respective feature as THEN.


CASE

Block CASE...OF...END is formatted according to setting of variables:

•	IND IN CASE NORM  - end of line and indentation after label in CASE (after colon) if neither BEGIN, IF nor CASE follows

•	IND IN CASE BEGIN  - end of line and indentation after label in CASE (after colon) if BEGIN follows

•	IND IN CASE IF  - end of line and indentation after label in CASE (after colon) if either IF or CASE follows

•	IND LABELS IN CASE  - end of line between multiple labels (every one on separate line)

•	IND CASE IN RECORD  - formatting of a CASE...OF block in a RECORD structure

Sizes of indentations follow these rules:

•	INDSIZE BEFORE LABEL IN CASE  - size of indentation of label in CASE...OF block

•	INDSIZE AFTER LABEL IN CASE  - size of indentation after label in CASE...OF block

Remark: ELSE branch is formatted the same as other branches - as if ELSE were label.


OBJECT type (CLASS etc.)

Keyword OBJECT represents :

OBJECT

CLASS	(Delphi)

INTERFACE	(Delphi)

DISPINTERFACE	(Delphi)

Formatting

OBJECT...END block is formatted in this way :

type

  .

  .

  TMyObject = object(TObject)

  private

    A, B : Integer;

    function GetA : Integer;

  public

    procedure SetPos(X, Y : Integer);

    .

    .

  end;

Reserved words PUBLIC, PRIVATE, PROTECTED (in Delphi) and AUTOMATED (in Delphi) are placed on original indent-position, everything else is indented. The size of indentation is INDSIZE IN OBJECT spaces.

Indent can also try to leave colons under each other in definition of variables if they were under each other in original source code. This behavior is controlled by IND CTV FORMAT variable (but it can't place colons place to the same column (under each other) if they weren't in the same column in the original source!).


RECORD

These variables influence formatting of RECORD block:

•	IND RECORD  - determines from which position will be items of record indented

•	IND CASE IN RECORD  - formatting of variant part (CASE...OF) of RECORD block

•	INDSIZE IN RECORD  - size of indentation of items in the RECORD block

•	IND CTV FORMAT  - whether leave colons in definitions of items in RECORD under each other (in the same column)


CONST, TYPE, VAR

In Delphi, RECOURCESTRING is formatted as well as CONST and THERADVAR as well as VAR.

Formatting:

•	IND AFTER CTV  - end of line after keywords CONST/TYPE/VAR

•	IND AFTER CTV IN PROCEDURE  - and of line after keywords CONST/TYPE/VAR when they are part of a definition of procedure(function)

Sizes of indentation:

•	INDSIZE AFTER CONST  - size of indentation of declarations of constants in the CONST block

•	INDSIZE AFTER CONST IN PROCEDURE  - size of indentation of constants in the CONST block in the definition of procedure(function)

•	INDSIZE AFTER TYPE  - size of indentation of declarations of types in the TYPE block

•	INDSIZE AFTER TYPE IN PROCEDURE  - size of indentation of declarations of types in the TYPE block in the definition of procedure(function)

•	INDSIZE AFTER VAR  - size of indentation of declarations of variables in the VAR block

•	INDSIZE AFTER VAR IN PROCEDURE  - size of indentation of declarations of types in the VAR block in the definition of procedure(function)

Indent can also try to leave equal signs (CONST, TYPE) and colons (VAR) under each other in definition of variables if they were under each other in original source code. This behavior is controlled by IND CTV FORMAT variable (but it can't place colons place to the same column (under each other) if they weren't in the same column in the original source!).

Formatting of constants, whose type is ARRAY or RECORD, can be influenced by setting of IND CONSTANT STRUCTURES variable.


USES

Formatting of the block USES is controlled by IND USES variable, which determines whether there should be an end of line after every name of unit or not.


EXPORTS

There is always end of line after keyword EXPORTS and after every exported procedure or function. Size of indentation is INDSIZE GENERAL.

Example

exports

  SetGraphics,

  DrawLine,

  PutPixel,

  ClearCanvas;


PROGRAM, LIBRARY, UNIT, LABEL

There is no end of line after these keywords until the nearest semicolon.

Example

program Indent;

label Navesti1, Navesti2;


Nested Procedures and Functions

IND PROCEDURE IN PROCEDURE variable determines whether nested procedures and functions will be indented. If so, size of indentation will be INDSIZE PROCEDURE IN PROCEDURE.


Strings

Strings (type STRING) can be automatically split up or joined - whether it is allowed and how to do it determine variables SERVER STRINGS and SEVER STRINGS ONLY ON SPACES. It is also possible to set up which one of the right margins (limits) will be used in different situations: STRINGS ALWAYS USE SOFT LIMIT.


Comments

No changes to content of comments are performed, they are never split up or joined, they are never formatted to some kind of blocks. Comments remain on lexically same places on which they were in original source. The reason for these restrictions is the fact that it is generally impossible to recognize which comments belongs to each other, which comment which commands or which are commands in comments (maybe temporarily) - in this case a move of the comment on another place (between different tokens) could cause problems witch further development of the formatted program.

Placement of comments can be influenced by these variables :

•	COMMENTS MODE  - main setting for placement of comments

•	SOFT LIMIT FOR COMMENTS  - determines whether use SOFT LIMIT or HARD LIMIT as right margin for comments

•	FIRST COMMENTS MODE  - sets special behaviour for comments before which there is nothing on a line (but spaces or tabulators), by another words they are first on the line

•	CUT TOO LONG COMMENTS  - allows to perform end of line in comments which overruns HARD LIMIT


Assembler

Assembler (content of a block ASM...END) is basically not been formatted, even there are no changes in case of letters there. The reason is very different syntax as well as "style" of assembler-formatting. It is possible to set up whether the block ASM...END will not be formatted at all, or whether there will be some formatting. This is controlled by variable IND ASSEMBLER. When formatting is on, then indentation is the same as in the block  BEGIN...END - see IND AFTER BEGIN, but size of indentation is adjustable separately by INDSIZE AFTER ASM variable.

By default, any formatting of assembler is switched off. If you switch it on, it can format assembler in bad way - so take special care when you switch it on.

Remark: The restrictions on ASM...END block are not related to comments - these ones are formatted in an ordinary way.

Variables influencing formatting of the ASM...END block :

•	IND ASSEMBLER  - whether will assembler be formatted partially or not at all

•	INDSIZE AFTER ASM  - size of indentation in ASM...END (when formatting and indenting is on)

•	IND AFTER BEGIN  - determines whether indentation takes place (when formatting is on)


Basic Principles of Spaces Insertion Mechanism

Spaces between tokens are determined by content of SPACES section of configuration file.

When we simplify a situation, than we can say, that in SPACES section we specify rules for enforcement and supression of spaces around tokens. These rules are: "force space", "supress space" and "leave original state". When we have situation   token1 <spaces?> token2 , than about count of spaces decide rule for right side of  token1 and rule for left side of token2. The one with higher priority of them will be used. (see SPACES section). When both of them have the same priority and are different, than the decision will follow this:  "leave original state" < "supress space" < "force space" . By another words, when priorities are the same, then  "force space" is the strongest.

When the mechanism decides, that there should be space(s) between tokens, than according to value of REDUCE SPACES variable it will be inserted either exactly one space or original count of spaces (but at least one). If there had been originally end of line (and any count of spaces) between tokens, than the original count of spaces is considered to be exactly one space.

Continuation - Group Tokens and their usage for spaces insertion mechanism

Example

What influences spaces insertion mechanism:

•	configuration file SPACES section

•	predefined and user Group Tokens

•	REDUCE SPACES  - fixed spaces (sequence of more spaces is replaced by one space)

•	USE ALL SPECIFICATIONS OF SPACES  - see Continuation - Group Tokens

•	USER GROUP TOKEN  -  "variable" for creation of new User Group Token


Continuation of Spaces Insertion Mechanism - Group Tokens

Beginning - Basic principles

Actually the process of decision-making, whether place or not place space(s) between tokens, is more complicated. Tokens can belong to certain groups - predefined and user ones. These groups are represented by  Group Tokens. Contents of groups ("which tokens they consist of") are either predefined or can be defined by user in a configuration file as (special) sections. As far as spaces insertion mechanism is concerned, the behaviour of groups (Group Tokens) can be defined by the same way as for ordinary tokens - in SPACES section of configuration file.

What are Group Tokens

Predefined Group Tokens

Declaration of User Group Tokens and definition of their content

When deciding about spaces-rules around  token , at first the algorithm comes through all Group Tokens. When token belongs to group of  Group Token , than the record for  Group Token  from SPACES section is applied on actual information about spaces-rules around token. Lastly the record for  token  is applied (when it exists).

Remark 1: The priorities (see Basic principles) are NOT used for application of "newly-found" records. Priorities are used to decide whether place or not place space(s) between tokens (comparison of "right rule" from the fist token and "left rule" from the second token), but not to determinate space-rules(force/supress/leave space(s)) around (one) token.

Remark 2: When the value of USE ALL SPECIFICATIONS OF SPACES variable is NO , than only last-found record is used for the  token  (sequential application of records doesn't take place).

Remark 3: The algorithm always preserves spaces on that places where it is inevitable because of syntax (e.g. when identifier follows identifier).

The order of application of records from SPACES section during determination of spaces-rules around different kinds of tokens is here.

Example


Ends-of-lines and Line Wrapping

There are several "kinds" of ends-of-lines(EOLs) and line wrapping:

•	The first are EOLs because of formatting of some command,

•	the second are EOLs that prevents line from overrunning the right limit,

•	the third one are EOLs of empty lines,

•	the fourth is the PEOLA mechanism.

The first one is entirely determined by chosen styles of formatting, the third one - empty lines - is taken from an original source (There will be empty lines in output where they are in original source code). It is possible to remove some superfluous empty lines - see REMOVE REDUNDANT EMPTY LINES variable.

Interesting and configurable is the second kind - EOL because of overrunning right limit of line.

You can also force EOLs everywhere where they were in the input source code - KEEP ALL EOLS variable.

Sorts of right limits of line

There are two right limits in the Pascal Indent:  SOFT LIMIT and HARD LIMIT. Both of them are of course adjustable.  HARD LIMIT is greater and specifies a column which should be never overrun (e.g. limit of compiler), while SOFT LIMIT is a column which should be not overrun by (output) source code itself , but not necessary by comments. But there are certain exceptions, when a code can overrun SOFT LIMIT, or when also comments are placed not to overrun SOFT LIMIT  - it is also connected with setting of some variables.

EOL forced by right limit

This kind of EOL takes place in a case when the right limit would be overrun if next token were added. When this EOL is used then the next line is indented. Size of indentation is INDSIZE CONTINUOUS LINE.

Example for  INDSIZE CONTINUOUS LINE = 4  :

  function FindValues(A : array[1..100] of array; Top :

      Integer; var Average : Integer);

Position in the line on which EOL will be inserted is located roughly following this procedure:

•	When PEOLA MODE = 0 : If there are tokens in line which are in PREFERRED EOL AFTER section of configuration file, then the rightmost one of them (which doesn't overrun right limit) is taken and after it EOL is inserted. Otherwise:

•	If users demands EOLs preferably on places where are (or should be according to spaces insertion mechanism) spaces (EOLS ONLY ON SPACES variable), then the rightmost space which doesn't overrun right limit is taken and on ins place EOL is inserted. Otherwise:

•	EOL is inserted after the rightmost token which doesn't overrun right limit.

In fact it is a bit more complicated because Indent can be adjusted not to place EOLs before semicolons and commas - see NO LEADING COMMAS AND SEMICOLONS variable.

PEOLA mechanism

PEOLA is an abbreviation of  "Preferred EOL After". This mechanism is activated after tokens from PREFERRED EOL AFTER section of configuration file (it can contain Group Tokens too). What will be in the concrete done is controlled by PEOLA MODE variable. The value of this variable is  0 by default. It means that PEOLA serves only for preferred EOL-insertion in the case of possible overrun of right limit - see above. When the value of PEOLA MODE is different, then PEOLA mechanism inserts EOL immediately after every token from PREFERRED EOL AFTER section (the value of PEOLA MODE adjusts indentation style after these EOLs).

Summary

What affects EOLs-insertion:

•	SOFT LIMIT  - adjusts right limit primarily for source code itself (without comments)

•	HARD LIMIT  - adjusts right limit mainly for comments

•	KEEP ALL EOLS  - whether EOLs will be inserted on every place where they were in input source

•	EOLS ONLY ON SPACES - when inserting EOLs because of right limit overrun, than these EOLs will be inserted only on places where are spaces (if it is possible)

•	NO LEADING COMMAS AND SEMICOLONS - EOLs are not inserted before commas and semicolons

•	REMOVE REDUNDANT EMPTY LINES  - removing empty superfluous empty lines (e.g. in the middle of expression)

•	configuration file PREFERRED EOL AFTER section - according to value of PEOLA MODE, either EOLs are preferably inserted after tokens from this section when preventing right limit overrun or EOLs are inserted after them always

•	PEOLA MODE  - determines behaviour of PEOLA mechanism (what to do after tokens from PREFERRED EOL AFTER).

These variables also affect EOLs-insertion:

•	SOFT LIMIT FOR COMMENTS  - determines which of the right limits - SOFT LIMIT or HARD LIMIT - serves as right limit for comments

•	CUT TOO LONG COMMENTS  - permission to insert EOL into comment if it overruns HARD LIMIT

•	STRINGS ALWAYS USE SOFT LIMIT  - strings never overrun SOFT LIMIT


Capitalizing and Lowering of Letters

Mechanism for capitalizing and lowering of letters serves primarily for modification of all occurrences of one identifier into unified form (e.g. begin, Begin, BeGiN nebo BEGIN  transform into unified form, for example BEGIN). This unified form can be specified in a configuration file or the first occurrence of an identifier in the input source can establish this unified form.

LOWER UPPER CASE section in configuration file contain plain list of identifiers in the unified form mentioned above. By FIRST OCCURENCE DECIDE variable you can switch on or off mechanism, which establish this unified form of identifier from the first occurrence of identifier - but not for identifiers from LOWER UPPER CASE section.

The mechanism can be used also for numbers - for hexadecimal notation and for exponent E. If the string "NUMBER"   (quoted; all letters capital) is a part of LOWER UPPER CASE section, then all letters in numbers will be capital. If string "number"  (quoted; all letters small) is there, then all letters in numbers will be in lowercase.

If none of these strings is in the LOWER UPPER CASE section, then no changes to letters in numbers will be performed.

The mechanism can be switched on only for parts of source code - see How to switch formatting on and off.

Remark: The whole mechanism works on text - it doesn't take care of logical structure of program. An identifier that is used in different procedures and function in different meanings is still the only one identifier for the mechanism.

Summary:

•	configuration file LOWER UPPER CASE section  - list of unified forms of identifiers

•	FIRST OCCURENCE DECIDE  - first occurrence of identifier is considered to be the unified form (only for identifiers which are not in LOWER UPPER CASE)

•	How to switch formatting on and off

Example


How to Switch Formatting On and Off

The functionality of Indent can be divided into two groups:

1) functionality that "changes positions" of text(source) - indenting and spaces insertion mechanism

2) functionality that doesn't "change positions" of text(source) - mechanism for capitalizing and lowering letters

These groups are switched on or off by following strings. These strings must be placed into input source code into comment and they must be alone there.

Strings that switch formatting on and off  :

•	*INDENT-ON*    - switches groups 1 and 2 on (switches complete formatting on) ; this string can be changed by setting of variable INDENT ON STRING

•	*INDENT-OFF*   - switches groups 1 and 2 off (switches complete formatting off) ; this string can be changed by setting of variable INDENT OFF STRING

•	*LUC-ON*       - switches group 2 on  (mechanism for capitalizing and lowering letters) ; this string can be changed by setting of variable LUC ON STRING

•	*LUC-OFF*      - switches group 2 off  (mechanism for capitalizing and lowering letters) ; this string can be changed by setting of variable LUC OFF STRING

Remark: If the formatting is switched off it means, that output will not be affected. But "inside" the whole Indent algorithm runs continuously (e.g. it still count the indentation, but it is not used for output now). So when it is than switched on again, following source will be formatted in the same way as if it were not switched off before.

Examples:

(Assume, that INDENT ON STRING, INDENT OFF STRING, LUC ON STRING and LUC OFF STRING variables were not changed.)

{ *INDENT-OFF* }   - switches complete formatting off

(* *LUC-ON* *)     - switches mechanism for capitalizing and lowering letters on

//*INDENT-ON*      - switches complete formatting on (including mechanism for capitalizing and lowering letters) ; remark: this kind of comment can be only in Delphi

{ *LUC-OFF* xx}    - it does nothing, because there are superfluous characters  xx  in comment


Introduction to Format Convertor

Format Convertor converts source code of Pascal (Delphi) into text format, which uses tags to describe format. Those are e.g. HTML, XML or TEX. Two things are needed for conversion:

•	insertion of tags according to Pascal syntax

•	overwriting some text strings by another ones - the reason for this is the fact, that some groups of characters represents tags and therefore they cannot appear in the text itself; text formats have always specified how to replace these problematic groups of characters (strings)

Format Convertor has functionality for all of this of course.


Tags Insertion Mechanism

Format Convertor provides functionality for insertion of tags before and after tokens (also according to membership of token to some groups of tokens), at the beginning and at the end of line and at the beginning and at the end of the whole text(source).

The mechanism is very similar to the spaces insertion mechanism. Tags are specified in FORMAT TAGS section of configuration file. In this section you can define left and right tag for tokens. Single tokens can belong to groups of tokens (and typically will belong). These groups are represented by special strings - Group Tokens. Group Tokens can also appear in FORMAT TAGS section. Than it means, that specified tags will be used for all tokens from the group.

Group Tokens are predefined ones and user ones - by another words, you can create your own Group Tokens.

Which tags will be inserted around concrete token? The brief answer is: Tags for all groups, which token belongs to, and tags for the token itself. Order of tag insertion is in this list. It is an order of tags before token. The order after token is reverse. These orders can be reversed by REVERSE TAGS ORDER.

In FORMAT TAGS section there can be also these special tokens:

•	"LINE"  - represents one line - tags for this token will be inserted to the beginning / to the end of every line

•	"FILE"  - represents the whole text (source) - tags for this token will be inserted to the beginning / to the end of the output source

Variables which control tags insertion mechanism:

•	USE ALL SPECIFICATIONS OF TAGS  - determines whether to put around token all corresponding tags or just the one tag - the one which would be inserted as the last

•	REVERSE TAGS ORDER  - reverse the order of inserted tags

•	REMOVE UNNECESSARY TAGS  - makes it possible not to insert tags in the case, when <left tag for token> immediately follows <right tag for token>  ; e.g. in HTML, sequence  </B> <B>  would not be inserted

•	CASE SENSITIVE TAGS  - when REMOVE UNNECESSARY TAGS = YES  (so some tags are removed), than it sets up, whether comparison of tags will be case sensitive or case insensitive (this comparison is performed to find out whether two tags belongs to one token as "left tag" and "right tag")

Example


Text Replacements

Text formats, which use tags, prohibit some sequences of characters in the text (because these sequences are reserved for tags). Prohibited strings (or characters) must be replaced by another strings (these rules are defined by that concrete text format). For example in HTML, characters  > ("greater sign") and  < ("less sign") must be replaced by strings  &gt  and  &lt.

The replace rules should be specified in TEXT REPLACEMENTS section of configuration file. The setting of CASE SENSITIVE REPLACEMENTS variable determines whether will these rules be case sensitive or insensitive.

Example


Basic Structure of Configuration File

Configuration file consists of two parts (in this order):

•	definition of values of variables

•	definition of sections

Definition of values of variables

Every line has this format:

variable   =   value

Definition of sections

At the beginning of section there is a header   [name_of_section]  , followed by lines which define content of the section (its format depends on type of section). Section ends on the header of next section or at the end of file.

•	names of variables are case insensitive

•	when the first non-whitespace character on a line is   #  , than this line is ignored (comment)

•	it is possible to use  %INCLUDE_SECTION%  command on every line of configuration file

•	there must not be duplicate definitions of sections (names of sections must be unique), variables can be repeated (but there are some special exceptions) - the last appearance is the valid one.

Example of configuration file


Command  %INCLUDE_SECTION%

By this command you can include to a configuration file a content of section from different file. Command

%INCLUDE_SECTION%  "name_of_file" : name_of_section

is replaced by content of  name_of_section  section from  name_of_file  file.  name_of_file  can contain full path or relative path. Relative path is relative to path in INCLUDE PATH variable and this path is relative to the placement of configuration file - not necessarily to the current directory.  name_of_section  has no connection with a placement of the command in the configuration file. But if the command is used in some section, lets call it for example  section_1 , then we can write this command in a shorter variant :

%INCLUDE_SECTION%  "name_of_file"

In this case,  section_1  section from the  name_of_file  file will be included into configuration file. It is not possible to use this shorter variant in definition of values of variables.

Remark: Quotes around  name_of_file  are optional, but highly recommended (they are necessary when  name_of_file   contains colon). If  name_of_file  is quoted, then it is not considered to be "a quoted string" in the terms of this topic. For example you should write "C:\myprog\bla.inc" and not "C:\\myprog\\bla.inc" .


Special meaning of character  (backslash) in quotes
Special Meaning of Character  \ (backslash) in Quotes

Some strings in the configuration file are quoted. Lets call them Quoted strings. For example:

"This text is quoted."

In Quoted strings the character  \  (backslash) has a special meaning - it introduces so called escape sequence, which is a sequence of character that will be replaced by another character.

Escape sequences:

•	\n  :  end of line

•	\t  :  tabulator

•	\"  :  character  "  (quotes)

•	\\  :  character  \  (backslash)

Example

Written in configuration file :

"This\\ \"text\"\nis\n\tquoted."

Actually it means:

This\ "text"

is

        quoted.


DELPHI

Variable:  DELPHI

Possible values:  YES, NO

Default value:  NO

Has effect in:  Indent, Format Convertor

Description

Lexical and syntax analysis can be performed for:

•	YES  -  Inprise Delphi 5.0. This mode is also usable for previous versions of Delphi, but newly introduced keywords must not occurValue must match these conditions in source code as ordinary identifiers.

•	NO  -  Borland Pascal 7.0.


SOFT LIMIT

Variable:  SOFT LIMIT

Possible values:  5 - 1000

Default value:  78

Has effect in:  Indent

Value must match these conditions:  SOFT LIMIT <= HARD LIMIT , SOFT LIMIT <= MAX LENGTH OF LINE

Description

SOFT LIMIT is a distance between start of line and right limit of line. This right limit is used primarily for tokens of Pascal itself - not for comments (but it can be also switched on). There can be some exceptions from this rule.

See also

EOLs,

HARD LIMIT,

SOFT LIMIT FOR COMMENTS,

STRINGS ALWAYS USE SOFT LIMIT,

MAX LENGTH OF LINE


HARD LIMIT

Variable:  HARD LIMIT

Possible values:  5 - 1000

Default value:  125

Has effect in:  Indent

Value must match these conditions:  HARD LIMIT <= MAX LENGTH OF LINE

Description

HARD LIMIT is a distance between start of line and right limit of line. Indent formats source code so that no token will overrun HARD LIMIT  (exception - see CUT TOO LONG COMMENTS). This right limit is mainly used for comments, but it can be changed - SOFT LIMIT FOR COMMENTS.

See also

EOLs,

SOFT LIMIT,

SOFT LIMIT FOR COMMENTS,

STRINGS ALWAYS USE SOFT LIMIT,

MAX LENGTH OF LINE


REDUCE SPACES

Variable:  REDUCE SPACES

Possible values:  YES, NO

Default value:  YES

Has effect in:  Indent

Description

•	YES  -  There will be at most one space between two neighbouring tokens - so one space or none.

•	NO  -  If the spaces insertion mechanism decides that there should be a space between tokens and there are more spaces in the original source, than the original count of spaces will be inserted.

See also

Spaces insertion mechanism


USE ALL SPECIFICATIONS OF SPACES

Variable:  USE ALL SPECIFICATIONS OF SPACES

Possible values:  YES, NO

Default value:  YES

Has effect in:  Indent

Description

It is possible to force or supress spaces around a token. Token can belong to several groups of tokens (represented by Group Tokens) - so there can be more "records" in SPACES section which relate to the token.

•	YES  -  All of these records are successively applied (in this order).

•	NO  -  Only the most "important" record for the token is used - it is the one which would be applied last.

See also

Spaces insertion mechanism,

Configuration file SPACES section,

Order of application of records from section SPACES,

Predefined and User Group Tokens


FIRST OCCURENCE DECIDE

Variable:  FIRST OCCURENCE DECIDE

Possible values:  YES, NO

Default value:  NO

Has effect in:  Indent

Description

•	YES  -  The format (as far as a case of letter is concerned) of an identifier, which is not in LOWER UPPER CASE section of configuration file, is determined by the first occurrence of that identifier.

•	NO  -  The case of letters in Identifiers, which are not in LOWER UPPER CASE section of configuration file, will be left unchanged.

See also

Capitalizing and Lowering of Letters,

Configuration file LOWER UPPER CASE section


PEOLA MODE

Variable:  PEOLA MODE

Possible values:  0 - 2

Default value:  0

Has effect in:  Indent

Description

Variable controls a behaviour of PEOLA mechanism. This mechanism is active only after tokens, which are specified in PREFERRED EOL AFTER section of configuration file.

•	0  -  When EOL should be inserted to line because of overrun of right limit than this EOL will be inserted after last token in the line which doesn't overrun right limit and which has the PEOLA mechanism active after itself (when there is no such token in the line then EOL will be typically inserted after last token which doesn't overrun right limit).

•	1  -  EOL will be inserted after every token which has PEOLA mechanism active. The size of following indentation will be set to the same value as if the EOL is inserted after semicolon.

•	2  -  EOL will be inserted after every token which has PEOLA mechanism active. The size of following indentation will be set to the same value as if the EOL is inserted due to overrun of right limit. (size of indentation is increased by INDSIZE CONTINUOUS LINE characters).

Examples

Example for PEOLA MODE

See also

Ends-of-lines and Line Wrapping, PEOLA mechanism,

Configuration file PREFERRED EOL AFTER section


COMMENTS MODE

Variable:  COMMENTS MODE

Possible values:  0 - 4

Default value:  3

Has effect in:  Indent

Description

The position of comments in original source can influence the position of comments in the output source. We distinguish three sorts of comments:

•	comments at the beginning of line: comments, which has no token before them in a line, but there are some tokens behind them (at least one)

•	comments in the middle of line: there are some tokens before as well as behind them

•	comments at the end of line: there are no tokens behind then in a line (even another comment)

•	0  -  All comments are always inserted to the beginning of new line.

•	1  -  All comments are inserted to a separate line and they are indented (size of indentation is not changed).

•	2  -  All comments are inserted as if they were identifiers.

•	3  -  Insertion of comments at the beginning of line is controlled by the setting of FIRST COMMENTS MODE variable, comments in the middle of line are inserted as if they were identifiers. Comments at the end of line are inserted to its original position in line. But if it is not possible (when the text in the output line before them overruns this position or if the comment inserted to its original position overrun right limit), the position in line can change - to the right or to the left. Though the comment needn't to fit into the rest of empty space at the and of line. In that case, comment is inserted to the new line to its original position (but again, it can be moved to the left due to overrun of right limit).

•	4  -  Insertion of comments at the beginning of line is controlled by the setting of variable FIRST COMMENTS MODE variable, comments in the middle of line are inserted as if they were identifiers. Comments at the end of line are inserted exactly to its original position in line. But if it is not possible (when the text in the output line before them overruns this position or if the comment inserted to its original position overrun right limit), comments are inserted to the new line to their original position (but again, they can be moved to the left due to overrun of right limit).

Example

See also

Formatting of comments,

FIRST COMMENTS MODE,

SOFT LIMIT FOR COMMENTS,

CUT TOO LOG COMMENTS


SOFT LIMIT FOR COMMENTS

Variable:  SOFT LIMIT FOR COMMENTS

Possible values:  YES, NO

Default value:  NO

Has effect in:  Indent

Description

The right limit of line for comments will be:

•	YES  -  SOFT LIMIT.

•	NO  -  HARD LIMIT.

See also

Formatting of comments,

SOFT LIMIT,

HARD LIMIT


CUT TOO LONG COMMENTS

Variable:  CUT TOO LONG COMMENTS

Possible values:  YES, NO

Default value:  YES

Has effect in:  Indent

Description

Pascal Indent doesn't interfere to the "interior" of comments. But simultaneously it guarantee, that nothing will overrun right limit - HARD LIMIT. In the case when the size of comment is greater than HARD LIMIT, the conflict of these aims occurr. Solution will be :

•	YES  -  EOLs are inserted into comments which originally overrun HARD LIMIT so that they will not overrun HARD LIMIT in the output.

•	NO  -  Comments which overrun HARD LIMIT are inserted to the output intact without any EOLs inside them.

See also

Formatting of comments,

COMMENTS MODE,

HARD LIMIT


FIRST COMMENTS MODE

Variable:  FIRST COMMENTS MODE

Possible values:  0, 1

Default value:  1

Has effect in:  Indent, if  COMMENTS MODE = 3  or  COMMENTS MODE = 4

Description

It adjusts formatting of comments when COMMENTS MODE is set up to 3 or 4. It controls insertion of comments, which are "the first" in line in original source - there is no token before them in line, but there some tokens behind them in line.

These comments are:

•	0  -  inserted as if they were identifiers.

•	1  -  inserted to its original position.

Example

See also

Formatting of comments,

COMMENTS MODE


SEVER STRINGS

Variable:  SEVER STRINGS

Possible values:  YES, NO

Default value:  YES

Has effect in:  Indent

Description

Strings:

•	YES  -  are joined or split as required by formatting. The setting of SEVER STRINGS ONLY ON SPACES variable determines, where it is allowed to split the string.

•	NO  -  are never joined or split.

See also

Formatting of strings,

SEVER STRINGS ONLY ON SPACES


SEVER STRINGS ONLY ON SPACES

Variable:  SEVER STRINGS ONLY ON SPACES

Possible values:  YES, NO

Default value:  YES

Has effect in:  Indent, if  SEVER STRINGS = YES

Description

This variable is used only when it is allowed to split and join strings - when SEVER STRINGS = YES.

It is allowed to split strings:

•	YES  -  only on places where are (should be according to formatting) spaces - if it is possible.

•	NO  -  everywhere.

See also

Formatting of string,

SEVER STRINGS


STRINGS ALWAYS USE SOFT LIMIT

Variable:  STRINGS ALWAYS USE SOFT LIMIT

Possible values:  YES, NO

Default value:  YES

Has effect in:  Indent, if  SEVER STRINGS = YES

Description

This variable is used only when it is allowed to split and join strings - when SEVER STRINGS = YES.

•	YES  -  When the size of indentation gets too big and it will be close too right limit SOFT LIMIT, then strings can overrun this limit a bit (only as is essential).

•	NO  -  Strings must not overrun SOFT LIMIT.

See also

Formatting of strings,

SEVER STRINGS,

SOFT LIMIT,

HARD LIMIT


KEEP ALL EOLS

Variable:  KEEP ALL EOLS

Possible values:  YES, NO

Default value:  NO

Has effect in:  Indent

Description

•	YES  -  All EOLs from input source will appear in the output source.

•	NO  -  Only EOLs from empty lines will appear in the output source.

See also

Ends-of-lines and Line Wrapping


REMOVE REDUNDANT EMPTY LINES

Variable:  REMOVE REDUNDANT EMPTY LINES

Possible values:  YES, NO

Default value:  YES

Has effect in:  Indent

Description

•	YES  -  Empty lines which are not allowed by formatting will be removed.

•	NO  -  All empty lines from original source will be also in the output.

Example

See also

Ends-of-lines and Line Wrapping


EOLS ONLY ON SPACES

Variable:  EOLS ONLY ON SPACES

Possible values:  YES, NO

Default value:  NO

Has effect in:  Indent

Description

EOLs are inserted:

•	YES  -  preferably only on places where should be a space (according to spaces insertion mechanism).

•	NO  -  without any respect for spaces.

See also

Ends-of-lines and Line Wrapping,

Spaces insertion mechanism


NO LEADING COMMAS AND SEMICOLONS

Variable:  NO LEADING COMMAS AND SEMICOLON

Possible values:  YES, NO

Default value:  YES

Has effect in:  Indent

Description

EOLs are :

•	YES  -  preferably inserted so that lines will not lead with semicolons or commas.

•	NO  -  inserted without any respect for commas and semicolons.

See also

Ends-of-lines and Line Wrapping


INPUT TAB SIZE

Variable:  INPUT TAB SIZE

Possible values:  1 - 50

Default value:  8

Has effect in:  Indent, Format Convertor

Description

Variable determines the size of tabulator in input source. All tabulators in the input source are converted to sequence of spaces.

See also

SPACES TO TABS,

OUTPUT TAB SIZE


SPACES TO TABS

Variable:  SPACES TO TABS

Possible values:  YES, NO

Default value:  NO

Has effect in:  Indent, Format Convertor

Description

Variable determines whether to convert sequences of spaces into tabulators in the output source. The size of tabulator in the output will be than OUTPUT TAB SIZE.

See also

OUTPUT TAB SIZE,

INPUT TAB SIZE


OUTPUT TAB SIZE

Variable:  OUTPUT TAB SIZE

Possible values:  1 - 50

Default value:  8

Has effect in:  Indent, Format Convertor, if  SPACES TO TABS = YES

Description

If spaces-to-tabulators conversion in the output is switched on, (SPACES TO TABS = YES), then the value of this variable will be the size of tabulator in the output source.

See also

SPACES TO TABS,

INPUT TAB SIZE


MAX LENGTH OF LINE

Variable:  MAX LENGHT OF LINE

Possible values:  10 - 10000

Default value:  1000

Has effect in:  Indent, Format Convertor

Description

Determines maximal length of line in the input source. This setting affects Pascal Indent memory management. It is recommended to change the value of this variable only when low of memory or when lines of the input source are extremely long.


IND BEFORE BEGIN

Variable:  IND BEFORE BEGIN

Possible values:  0 - 1

Default value:  0

Has effect in:  Indent

Description

There are no EOLs inserted before BEGIN.

•	0  -  There is no indentation before BEGIN.

•	1  -  It will be indented before BEGIN. The size of indentation: When THEN follows BEGIN, then it is INDSIZE AFTER THEN BEGIN, when ELSE follows BEGIN, then it is INDSIZE AFTER ELSE BEGIN. In other cases the size of indentation is INDSIZE BEFORE BEGIN.

Examples

Example for IND BEFORE BEGIN, Examples of BEGIN...END formatting, Example for IND AFTER THEN BEGIN, Example for IND AFTER ELSE BEGIN, Example for IND IN CASE BEGIN

See also

Formatting of BEGIN...END block,

INDSIZE BEFORE BEGIN,

INDSIZE AFTER THEN BEGIN,

INDSIZE AFTER ELSE BEGIN,

Formatting of IF...THEN block,

Formatting after ELSE,


IND AFTER BEGIN

Variable:  IND AFTER BEGIN

Possible values:  0 - 2

Default value:  0

Has effect in:  Indent

Description

Variable controls formatting of commands in BEGIN...END block. When it is indented after BEGIN, then it means, that it is indented relatively to the position on which was BEGIN really inserted (so "to indent" doesn't necessary mean "to increase indentation by fixed value"). END will be inserted exactly under BEGIN - on the position on which was BEGIN inserted.

After BEGIN :

•	0  -  EOL will be inserted and it will be indented (size of indentation: INDSIZE AFTER BEGIN).

•	1  -  it will be only indented (size of indentation: INDSIZE AFTER BEGIN).

•	2  -  only EOL will be inserted.

Examples

Example for IND AFTER BEGIN, Examples of BEGIN...END formatting

See also

Formatting of BEGIN...END blocks,

INDSIZE AFTER BEGIN


IND BEFORE THEN

Variable:  IND BEFORE THEN

Possible values:  0 - 1

Default value:  0

Has effect in:  Indent

Description

Before THEN:

•	0  -  nothing will be done (no EOL), THEN will be inserted as well as ordinary token.

•	1  -  EOL will be inserted and THEN itself will be inserted "under" IF - on position on which IF was inserted.

Examples

Example for IND BEFORE THEN

See also

Formatting of IF...THEN blocks


IND AFTER THEN NORM

Variable:  IND AFTER THEN NORM

Possible values:  0 - 1

Default value:  0

Has effect in:  Indent

Value of this variable is default value of:  IND AFTER ELSE NORM

Description

Variable controls formatting after THEN when no "block command" (BEGIN, IF, CASE,...) follows.

After THEN:

•	0  -  nothing will be done (no EOL, no indentation).

•	1  -  EOL will be inserted and it will be indented ; size of indentation will be INDSIZE AFTER THEN NORM.

Examples

Example for IND AFTER THEN NORM

See also

Formatting of IF...THEN blocks,

INDSIZE AFTER THEN NORM


IND AFTER THEN BEGIN

Variable:  IND AFTER THEN BEGIN

Possible values:  0 - 2

Default value:  0

Has effect in:  Indent

Value of this variable is default value of:  IND AFTER ELSE BEGIN

Description

Variable controls formatting after THEN when BEGIN follows.

After THEN:

•	0  -  EOL will be inserted. The rest is controlled by settings for BEGIN...END block, see IND BEFORE BEGIN. When it is indented before BEGIN, then the size of indentation is INDSIZE AFTER THEN BEGIN.

•	1  -  it will be only indented (no EOL) ; size of indentation is INDSIZE AFTER THEN BEGIN (there is no respect to IND BEFORE BEGIN).

•	2  -  nothing will be done (no EOL). Everything else is controlled by IND BEFORE BEGIN. When it is indented before BEGIN, then the size of indentation is INDSIZE AFTER THEN BEGIN.

•	3  -  This is the special mode with no respect to IND BEFORE BEGIN. Nothing is done after THEN, so BEGIN is inserted immediately after it. An indentation inside BEGIN...END block is relative to position of IF (not to position of BEGIN). Finally END is inserted under IF.

Examples

Example for IND AFTER THEN BEGIN

See also

Formatting of IF...THEN blocks,

INDSIZE AFTER THEN BEGIN,

Formatting of BEGIN...END blocks,

IND BEFORE BEGIN


IND AFTER THEN IF

Variable:  IND AFTER THEN IF

Possible values:  0 - 2

Default value:  2

Has effect in:  Indent

Value of this variable is default value of:  IND AFTER ELSE IF

Description

Variable controls formatting after THEN when IF or CASE follows.

After THEN:

•	0  -  nothing is done.

•	1  -  EOL will be inserted.

•	2  -  EOL will be inserted and it will be indented. Size of indentation is INDSIZE AFTER THEN IF.

Examples

Example for IND AFTER THEN IF

See also

Formatting of IF...THEN block,

INDSIZE AFTER THEN IF,

Formatting of CASE...OF...END block


IND AFTER ELSE NORM

Variable:  IND AFTER ELSE NORM

Possible values:  0 - 1

Default value:  IND AFTER THEN NORM

Has effect in:  Indent

Description

Variable controls formatting after ELSE when no "block command" (BEGIN, IF, CASE,...) follows.

After ELSE:

•	0  -  nothing will be done (no EOL, no indentation).

•	1  -  EOL will be inserted and it will be indented ; size of indentation will be INDSIZE AFTER ELSE NORM.

Examples

Example for IND AFTER ELSE NORM

See also

Formatting after ELSE,

Formatting of IF...THEN blocks,

INDSIZE AFTER ELSE NORM


IND AFTER ELSE BEGIN

Variable:  IND AFTER ELSE BEGIN

Possible values:  0 - 2

Default value:  IND AFTER THEN BEGIN

Has effect in:  Indent

Description

Variable controls formatting after ELSE when BEGIN follows.

After ELSE:

•	0  -  EOL will be inserted. The rest is controlled by settings for BEGIN...END block, see IND BEFORE BEGIN. When it is indented before BEGIN, then the size of indentation is INDSIZE AFTER ELSE BEGIN.

•	1  -  it will be only indented (no EOL) ; size of indentation is INDSIZE AFTER ELSE BEGIN (there is no respect to IND BEFORE BEGIN).

•	2  -  nothing will be done (no EOL). Everything else is controlled by IND BEFORE BEGIN. When it is indented before BEGIN, then the size of indentation is INDSIZE AFTER ELSE BEGIN.

•	3  -  This is the special mode with no respect to IND BEFORE BEGIN. Nothing is done after ELSE, so BEGIN is inserted immediately after it. An indentation inside BEGIN...END block is relative to position of IF (not to position of BEGIN). Finally END is inserted under IF.

Examples

Example for IND AFTER ELSE BEGIN

See also

Formatting after ELSE,

INDSIZE AFTER ELSE BEGIN,

Formatting of BEGIN...END blocks,

IND BEFORE BEGIN,

Formatting of IF...THEN blocks


IND AFTER ELSE IF

Variable:  IND AFTER ELSE IF

Possible values:  0 - 2

Default value:  IND AFTER THEN IF

Has effect in:  Indent

Description

Variable controls formatting after ELSE when IF or CASE follows.

After ELSE:

•	0  -  nothing is done.

•	1  -  EOL will be inserted.

•	2  -  EOL will be inserted and it will be indented. Size of indentation is INDSIZE AFTER ELSE IF.

Examples

Example for IND AFTER ELSE IF

See also

Formatting after ELSE,

INDSIZE AFTER ELSE IF,

Formatting of CASE...OF...END blocks,

Formatting of IF...THEN blocks


IND IN CASE NORM

Variable:  IND IN CASE NORM

Possible values:  0 - 1

Default value:  0

Has effect in:  Indent

Description

Variable controls formatting after label in CASE...OF...END block when no "block command" (BEGIN, IF, CASE,...) follows.

After label:

•	0  -  nothing will be done (no EOL, no indentation).

•	1  -  EOL will be inserted and it will be indented ; size of indentation will be INDSIZE AFTER LABEL IN CASE.

Remark: ELSE branch is formatted the same as other branches - as if ELSE were label.

Examples

Example for IND IN CASE NORM

See also

Formatting of CASE...OF...END block,

INDSIZE AFTER LABEL IN CASE


IND IN CASE BEGIN

Variable:  IND IN CASE BEGIN

Possible values:  0 - 1

Default value:  1

Has effect in:  Indent

Description

Variable controls formatting after label in CASE...OF...END block when BEGIN follows.

After label:

•	0  -  nothing will be done (BEGIN will follow immediately).

•	1  -  EOL will be inserted and it will be indented relatively to the position of label. When there is usually no indentation before BEGIN (IND BEFORE BEGIN = 0), then the size of indentation will be INDSIZE AFTER LABEL IN CASE, otherwise  (IND BEFORE BEGIN = 1)  the size of indentation will be INDSIZE BEFORE BEGIN.

Remark: ELSE branch is formatted the same as other branches - as if ELSE were label.

Examples

Example for IND IN CASE BEGIN

See also

Formatting of CASE...OF...END block,

INDSIZE AFTER LABEL IN CASE

Formatting of BEGIN...END blocks,

IND BEFORE BEGIN,

INDSIZE BEFORE BEGIN


IND IN CASE IF

Variable:  IND IN CASE IF

Possible values:  0 - 1

Default value:  1

Has effect in:  Indent

Description

Variable controls formatting after label in CASE...OF...END block when IF or CASE follows.

After label:

•	0  -  nothing will be done (no EOL, no indentation).

•	1  -  EOL will be inserted and it will be indented. Size of indentation is INDSIZE AFTER LABEL IN CASE.

Remark: ELSE branch is formatted the same as other branches - as if ELSE were label.

Examples

Example for IND IN CASE IF

See also

Formatting of CASE...OF...END block,

INDSIZE AFTER LABEL IN CASE,

Formatting of IF...THEN blocks


IND LABELS IN CASE

Variable:  IND LABELS IN CASE

Possible values:  0 - 1

Default value:  0

Has effect in:  Indent

Description

Multiple labels in CASE...OF...END block will be placed:

•	0  -  one after another on one line.

•	1  -  everyone on separate line - EOLs will be inserted after commas which separates labels.

Labels are indented relatively to the position of command CASE. Size of indentation will be INDSIZE BEFORE LABEL IN CASE.

Examples

Example for IND LABELS IN CASE

See also

Formatting of CASE...OF...END block,

INDSIZE BEFORE LABEL IN CASE


IND RECORD

Variable:  IND RECORD

Possible values:  0 - 1

Default value:  0

Has effect in:  Indent

Description

Keyword RECORD itself is inserted as an ordinary token, no EOL is inserted before it. EOL will be inserted after RECORD. Size of indentation of items of RECORD structure is INDSIZE IN RECORD. This indentation is relative to:

•	0  -  original indentation. END will be placed to "the position" of original indentation.

•	1  -  the position of RECORD. END will be placed under RECORD.

Variable part of RECORD...END block (part CASE...OF) is formatted according to setting of variable IND CASE IN RECORD.

Examples

Example for IND RECORD

See also

Formatting of RECORD...END block,

INDSIZE IN RECORD,

IND CASE IN RECORD,

Formatting of CASE...OF...END block


IND CASE IN RECORD

Variable:  IND CASE IN RECORD

Possible values:  0 - 2

Default value:  0

Has effect in:  Indent

Description

•	0  -  No EOLs are inserted after labels (in CASE...OF block) as well as after semicolons separating items (in parentheses).

•	1  -  EOLs are inserted after semicolons in parentheses - every item is on a new line. Items are placed on he position of the first item.

•	2  -  EOL is inserted after first parenthesis after label. Items are indented relatively to position of label. Size of indentation is INDSIZE AFTER LABEL IN CASE. EOLs are also inserted after semicolons in parentheses - every item is on a new line.

Labels are indented relatively to position of CASE keyword. Size of indentation is INDSIZE BEFORE LABEL IN CASE.

Examples

Example for IND CASE IN RECORD

See also

Formatting of RECORD...END block,

INDSIZE AFTER LABEL IN CASE,

INDSIZE BEFORE LABEL IN CASE,

Formatting of CASE...OF...END block


IND PROCEDURE IN PROCEDURE

Variable:  IND PROCEDURE IN PROCEDURE

Possible values:  0 - 1

Default value:  1

Has effect in:  Indent

Description

Nested procedures and functions are:

•	0  -  not indented.

•	1  -  are indented. Size of indentation is INDSIZE PROCEDURE IN PROCEDURE.

Examples

Example for IND PROCEDURE IN PROCEDURE

See also

Formatting of nested procedures and functions,

INDSIZE PROCEDURE IN PROCEDURE


IND LABELS

Variable:  IND LABELS

Possible values:  0 - 3

Default value:  0

Has effect in:  Indent

Description

Labels are inserted:

•	0  -  on the position of "latest" BEGIN, EOLs are inserted after them.

•	1  -  on the position of "latest" BEGIN, EOLs are not inserted after them.

•	2  -  on the beginning of line (position 0), EOLs are inserted after them.

•	3  -  on the beginning of line (position 0), EOLs are not inserted after them.

Examples

Example for IND LABELS


IND USES

Variable:  IND USES

Possible values:  0 - 1

Default value:  0

Has effect in:  Indent

Description

After USES:

•	0  -  no EOL is inserted, all units are one after another on the same line.

•	1  -  EOL is inserted. EOLs are inserted also after all commas separating names of units - every name of unit is on a separate line. Size of indentation is INDSIZE GENERAL.

Examples

Example for IND USES

See also

INDSIZE GENERAL


IND ASSEMBLER

Variable:  IND ASSEMBLER

Possible values:  0 - 1

Default value:  0

Has effect in:  Indent

Description

•	0  -  Commands of integrated assembler (in ASM...END block) are inserted exactly on their original positions in the input source. This rule is not applied onto comments, they are formatted in an ordinary way.

•	1  -  Pascal Indent will try to indent commands of assembler - the size of indentation will be INDSIZE AFTER ASM. Comments are formatted in an ordinary way.

Examples

Example for IND ASSEMBLER

See also

Formatting of integrated assembler commands,

INDSIZE AFTER ASM,

Formatting of comments


IND CONSTANT STRUCTURES

Variable:  IND CONSTANT STRUCTURES

Possible values:  0 - 2

Default value:  0

Has effect in:  Indent

Description

Variable determines how to format constant arrays and constant structures of RECORD. It is very problematic to format these "constants", because Pascal Indent cannot fundamentally recognize their inner structure - e.g. multidimensional arrays.

•	0  -  This formatting is a bit magical. Pascal Indent will try to estimate inner structure of an constant array(or record) by the help of the first EOL in this constant array in the original source. So if the constant array was somehow "reasonably" formatted in the original source, then it is very probable that our formatting will be done well (it will appear as you would expected).

•	1  -  In the constant structure, the EOLs in the output will be inserted exactly to that positions, on which there are EOLs in the input source.

•	2  -  In the constant structure, the EOL will be inserted after every comma and every semicolon - it means : one item = one line.


IND CTV FORMAT

Variable:  IND CTV FORMAT

Possible values:  0 - 255

Default value:  0

Has effect in:  Indent

Description

In Pascal it is common to put equal signs (=) or colons (:) under each other when declaring constants, types or variables. Pascal Indent cannot produce this formatting, but it can try not to corrupt it - by another words it can try to place equal signs and colons under each other when they were under each other in the original source.

The value for this variable is counted as a sum of several following values - a sum of those ones, which correspond to those places in program, where you want this mechanism to be active.

Value 0 means, that Pascal Indent will never try to leave equal signs and colons under each other, value 255 means, that Pascal Indent will try to do it always.

•	1  -  global CONST block - outside procedures and functions (definitions of constants ; equal signs)

•	2  -  local CONST blocks - inside procedures and functions (definitions of constants ; equal signs)

•	4  -  global TYPE block - outside procedures and functions (definitions of types ; equal signs)

•	8  -  local TYPE blocks - inside procedures and functions (definitions of types ; equal signs)

•	16  -  global VAR block - outside procedures and functions (definitions of variables ; colons)

•	32  -  local VAR blocks - inside procedures and functions (definitions of variables ; colons)

•	64  -  RECORD...END blocks (definitions of RECORD structures ; colons)

•	128  -  OBJECT...END blocks (definitions of objects (classes) ; colons)

Example

If we want to have the mechanism active in all TYPE blocks and in RECORD...END blocks. Resulting value will be a sum 4 + 8 + 64 = 76  (4 - in global TYPE block; 8 - in local TYPE blocks ; 64 - in RECORD...END blocks).

IND CTV FORMAT = 76

See also

Formatting of CONST, TYPE and VAR blocks,

Formatting of RECORD...END block,

Formatting of blocks OBJECT...END


IND AFTER CTV

Variable:  IND AFTER CTV

Possible values:  0 - 1

Default value:  1 when  IND AFTER BEGIN = 1;  0 otherwise

Has effect in:  Indent

Value of this variable is default value of:  IND AFTER CTV IN PROCEDURE

Description

After CONST, TYPE and VAR keywords in global declaration section (outside procedures and functions), :

•	0  -  EOLs are not inserted.

•	1  -  EOLs are inserted.

Examples

Example for IND AFTER CTV

See also

Formatting of CONST, TYPE and VAR blocks,

IND AFTER BEGIN,

IND AFTER CTV IN PROCEDURE,

INDSIZE AFTER CONST,

INDSIZE AFTER TYPE,

INDSIZE AFTER VAR


IND AFTER CTV IN PROCEDURE

Variable:  IND AFTER CTV IN PROCEDURE

Possible values:  0 - 1

Default value:  IND AFTER CTV

Has effect in:  Indent

Description

After CONST, TYPE and VAR keywords in local declaration sections (inside procedures and functions), :

•	0  -  EOLs are not inserted.

•	1  -  EOLs are inserted.

Examples

Example for IND AFTER CTV

See also

Formatting of CONST, TYPE and VAR blocks,

IND AFTER CTV,

INDSIZE AFTER CONST IN PROCEDURE,

INDSIZE AFTER TYPE IN PROCEDURE,

INDSIZE AFTER VAR IN PROCEDURE


INDSIZE GENERAL

Variable:  INDSIZE GENERAL

Possible values:  0 - 100

Default value:  2

Has effect in:  Indent

Value of this variable is default value of:

  INDSIZE CONTINUOUS LINE,

  INDSIZE BEFORE BEGIN,

  INDSIZE AFTER BEGIN,

  INDSIZE AFTER THEN NORM,

  INDSIZE AFTER THEN BEGIN,

  INDSIZE AFTER THEN IF,

  INDSIZE IN RECORD,

  INDSIZE IN OBJECT,

  INDSIZE PROCEDURE IN PROCEDURE,

  INDSIZE AFTER CONST,

  INDSIZE AFTER TYPE,

  INDSIZE AFTER VAR,

  INDSIZE BEFORE LABEL IN CASE,

  INDSIZE AFTER LABEL IN CASE,

Description

Default value of all sizes of indentation (directly or indirectly).

See also

INDSIZE CONTINUOUS LINE,

INDSIZE BEFORE BEGIN,

INDSIZE AFTER BEGIN,

INDSIZE AFTER THEN NORM,

INDSIZE AFTER THEN BEGIN,

INDSIZE AFTER THEN IF,

INDSIZE IN RECORD,

INDSIZE IN OBJECT,

INDSIZE PROCEDURE IN PROCEDURE,

INDSIZE AFTER CONST,

INDSIZE AFTER TYPE,

INDSIZE AFTER VAR,

INDSIZE BEFORE LABEL IN CASE,

INDSIZE AFTER LABEL IN CASE,

INDSIZE AFTER ASM,

INDSIZE AFTER ELSE NORM,

INDSIZE AFTER ELSE BEGIN,

INDSIZE AFTER ELSE IF,

INDSIZE AFTER CONST IN PROCEDURE,

INDSIZE AFTER TYPE IN PROCEDURE,

INDSIZE AFTER VAR IN PROCEDURE


INDSIZE CONTINUOUS LINE

Variable:  INDSIZE CONTINUOUS LINE

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Description

Size of indentation for situation when the EOL was inserted to line due to overrun of right limit (SOFT LIMIT) - the rest of line continues on a new line and is indented by value of this variable.

See also

INDSIZE GENERAL,

SOFT LIMIT


INDSIZE BEFORE BEGIN

Variable:  INDSIZE BEFORE BEGIN

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Description

Size of indentation before BEGIN in several situations - see IND BEFORE BEGIN.

Examples

Example for IND BEFORE BEGIN

See also

INDSIZE GENERAL,

IND BEFORE BEGIN,

Formatting of BEGIN...END blocks


INDSIZE AFTER BEGIN

Variable:  INDSIZE AFTER BEGIN

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Description

Size of indentation after BEGIN (how much are commands in BEGIN...END block indented relatively to the position of BEGIN). The value is used only when the indentation after BEGIN is switched on - see IND AFTER BEGIN.

Examples

Example for IND AFTER BEGIN, Examples of BEGIN...END formating

See also

INDSIZE GENERAL,

IND AFTER BEGIN,

Formatting of BEGIN...END blocks


INDSIZE AFTER THEN NORM

Variable:  INDSIZE AFTER THEN NORM

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Value of this variable is default value of:  IND AFTER ELSE NORM

Description

Size of indentation after THEN when no "block command" (BEGIN, IF, CASE,...) follows and when this indentation is switched on - see IND AFTER THEN NORM.

Examples

Example for IND AFTER THEN NORM

See also

INDSIZE GENERAL,

IND AFTER THEN NORM,

Formatting of IF...THEN blocks


INDSIZE AFTER THEN BEGIN

Variable:  INDSIZE AFTER THEN BEGIN

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Value of this variable is default value of:  INDSIZE AFTER ELSE BEGIN

Description

Size of indentation after THEN when BEGIN follows and when this indentation is switched on - see IND AFTER THEN BEGIN.

Examples

Example for IND AFTER THEN BEGIN

See also

INDSIZE GENERAL,

IND AFTER THEN BEGIN,

Formatting of IF...THEN blocks,

Formatting of BEGIN...END blocks


INDSIZE AFTER THEN IF

Variable:  INDSIZE AFTER THEN IF

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Value of this variable is default value of:  INDSIZE AFTER ELSE IF

Description

Size of indentation after THEN when IF or CASE follows and when this indentation is switched on - see IND AFTER THEN IF.

Examples

Example for IND AFTER THEN IF

See also

INDSIZE GENERAL,

IND AFTER THEN IF,

Formatting of IF...THEN blocks,

Formatting of CASE...OF...END block


INDSIZE AFTER ELSE NORM

Variable:  INDSIZE AFTER ELSE NORM

Possible values:  0 - 100

Default value:  INDSIZE AFTER THEN NORM

Has effect in:  Indent

Description

Size of indentation after ELSE when no "block command" (BEGIN, IF, CASE,...) follows and when this indentation is switched on - see IND AFTER ELSE NORM.

Examples

Example for IND AFTER ELSE NORM

See also

INDSIZE AFTER THEN NORM,

IND AFTER ELSE NORM,

Formatting after ELSE


INDSIZE AFTER ELSE BEGIN

Variable:  INDSIZE AFTER ELSE BEGIN

Possible values:  0 - 100

Default value:  INDSIZE AFTER THEN BEGIN

Has effect in:  Indent

Description

Size of indentation after ELSE when BEGIN follows and when this indentation is switched on - see IND AFTER ELSE BEGIN.

Examples

Example for IND AFTER ELSE BEGIN

See also

INDSIZE AFTER THEN NORM,

IND AFTER ELSE BEGIN,

Formatting after ELSE,

Formatting of BEGIN...END blocks


INDSIZE AFTER ELSE IF

Variable:  INDSIZE AFTER ELSE IF

Possible values:  0 - 100

Default value:  INDSIZE AFTER THEN IF

Has effect in:  Indent

Description

Size of indentation after ELSE when IF or CASE follows and when this indentation is switched on - see IND AFTER ELSE IF.

Examples

Example for IND AFTER ELSE IF

See also

INDSIZE AFTER THEN NORM,

IND AFTER ELSE IF,

Formatting after ELSE,

Formatting of CASE...OF...END block


INDSIZE IN RECORD

Variable:  INDSIZE IN RECORD

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Description

Size of indentation of commands in RECORD...END block. (IND RECORD variable determines, to which position is this indentation relative.)

Examples

Example for IND RECORD

See also

INDSIZE GENERAL,

IND RECORD,

Formatting of RECORD...END block


INDSIZE IN OBJECT

Variable:  INDSIZE IN OBJECT

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Description

Size of indentation of commands in OBJECT...END block.

See also

INDSIZE GENERAL,

Formatting of OBJECT...END blocks (CLASS etc.)


INDSIZE PROCEDURE IN PROCEDURE

Variable:  INDSIZE PROCEDURE IN PROCEDURE

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Description

Size of indentation of nested procedures and functions when this indentation is switched on - see IND PROCEDURE IN PROCEDURE.

Examples

Example for IND PROCEDURE IN PROCEDURE

See also

INDSIZE GENERAL,

IND PROCEDURE IN PROCEDURE,

Formatting of nested procedures and functions


INDSIZE BEFORE LABEL IN CASE

Variable:  INDSIZE BEFORE LABEL IN CASE

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Description

Size of indentation of labels in CASE...OF...END block. The indentation is relative to the position of CASE keyword.

Examples

Example for IND LABELS IN CASE

See also

INDSIZE GENERAL,

Formatting of CASE...OF...END block


INDSIZE AFTER LABEL IN CASE

Variable:  INDSIZE AFTER LABEL IN CASE

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Description

Size of indentation after label in CASE...OF...END block when this indentation is switched on - see IND IN CASE NORM, IND IN CASE BEGIN and IND IN CASE IF. The indentation is relative to the position of label. There is one exception when the value INDSIZE AFTER LABEL IN CASE is not used - see description of IND IN CASE BEGIN.

Examples

Example for IND IN CASE NORM, Example for IND IN CASE BEGIN, Example for IND LABELS IN CASE

See also

INDSIZE GENERAL,

IND IN CASE NORM,

IND IN CASE BEGIN,

IND IN CASE IF,

Formatting of CASE...OF...END block


INDSIZE AFTER ASM

Variable:  INDSIZE AFTER ASM

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Description

Size of indentation of commands of integrated assembler (ASM...END block) when this indentation is switched on - see IND ASSEMBLER.

Examples

Example for IND ASSEMBLER

See also

INDSIZE GENERAL,

IND ASSEMBLER,

Formatting of integrated assembler commands


INDSIZE AFTER CONST

Variable:  INDSIZE AFTER CONST

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Value of this variable is default value of:  INDSIZE AFTER CONST IN PROCEDURE

Description

Size of indentation after CONST keyword in global declaration section (outside procedures and functions).

Examples

Example for IND AFTER CTV

See also

INDSIZE GENERAL,

INDSIZE AFTER CONST IN PROCEDURE,

Formatting of CONST, TYPE and VAR blocks


INDSIZE AFTER CONST IN PROCEDURE

Variable:  INDSIZE AFTER CONST IN PROCEDURE

Possible values:  0 - 100

Default value:  INDSIZE AFTER CONST

Has effect in:  Indent

Description

Size of indentation after CONST keyword in local declaration sections (inside procedures and functions).

Examples

Example for IND AFTER CTV

See also

INDSIZE AFTER CONST,

Formatting of CONST, TYPE and VAR blocks


INDSIZE AFTER TYPE

Variable:  INDSIZE AFTER TYPE

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Value of this variable is default value of:  INDSIZE AFTER TYPE IN PROCEDURE

Description

Size of indentation after TYPE keyword in global declaration section (outside procedures and functions).

Examples

Example for IND AFTER CTV

See also

INDSIZE GENERAL,

INDSIZE AFTER TYPE IN PROCEDURE,

Formatting of CONST, TYPE and VAR blocks


INDSIZE AFTER TYPE IN PROCEDURE

Variable:  INDSIZE AFTER TYPE IN PROCEDURE

Possible values:  0 - 100

Default value:  INDSIZE AFTER TYPE

Has effect in:  Indent

Description

Size of indentation after TYPE keyword in local declaration sections (inside procedures and functions).

Examples

Example for IND AFTER CTV

See also

INDSIZE AFTER TYPE,

Formatting of CONST, TYPE and VAR blocks


INDSIZE AFTER VAR

Variable:  INDSIZE AFTER VAR

Possible values:  0 - 100

Default value:  INDSIZE GENERAL

Has effect in:  Indent

Value of this variable is default value of:  INDSIZE AFTER VAR IN PROCEDURE

Description

Size of indentation after VAR keyword in global declaration section (outside procedures and functions).

Examples

Example for IND AFTER CTV

See also

INDSIZE GENERAL,

INDSIZE AFTER VAR IN PROCEDURE,

Formatting of CONST, TYPE and VAR blocks


INDSIZE AFTER VAR IN PROCEDURE

Variable:  INDSIZE AFTER VAR IN PROCEDURE

Possible values:  0 - 100

Default value:  INDSIZE AFTER VAR

Has effect in:  Indent

Description

Size of indentation after VAR keyword in local declaration sections (inside procedures and functions).

Examples

Example for IND AFTER CTV

See also

INDSIZE AFTER VAR,

Formatting of CONST, TYPE and VAR blocks


REVERSE TAGS ORDER

Variable:  REVERSE TAGS ORDER

Possible values:  YES, NO

Default value:  NO

Has effect in:  Format Convertor, if  USE ALL SPECIFICATIONS OF TAGS = YES

Description

Determines whether tags are inserted around token in normal or reverse order (when there should be more tags inserted around token - see Tags insertion mechanism and USE ALL SPECIFICATIONS OF TAGS).

•	YES  -  Tags are inserted in reverse order (than it is ordinary), approximately in this way:  <more concrete left tag><more general left tag>token<more general right tag><more concrete right tag>

•	NO  -  Tags are inserted in the ordinary order, approximately in this way:  <more general left tag><more concrete left tag>token<more concrete right tag><more general right tag>

See also

Tags insertion mechanism,

Configuration file FORMAT TAGS section,

USE ALL SPECIFICATIONS OF TAGS,

Order of tags insertion,

Predefined and User Group Tokens


REMOVE UNNECESSARY TAGS

Variable:  REMOVE UNNECESSARY TAGS

Possible values:  YES, NO

Default value:  YES

Has effect in:  Format Convertor

Description

When Format Convertor inserts tags to the source, following situation can occurr: in the output left tag of the token (or Group Token) immediately follows right tag of that token (e.g. in HTML </B><B> ).

•	YES  -  These tags will be removed from output.

•	NO  -  No removing will be performed.

The comparison, which finds out whether two tags belongs to one token as "left tag" and "right tag", can be case sensitive or case insensitive - see CASE SENSITIVE TAGS.

Warning

When the comparison of tags is performed than complete tags are compared! For example, let the FORMAT TAGS section of configuration file looks like (and  REMOVE UNNECESSARY TAGS = YES ):

[FORMAT TAGS]

begin  "<B><U>"  "</U></B>"

end    "<B>"     "</B>"

When there will be tokens  begin end  in the input, the output will be :

<B><U>begin</U></B><B>end</B>

Maybe you would expected, that there sequence  </B><B>  will not appear in the output. But Format Convertor doesn't know the inner structure of tags and it always compare complete tags - so he compared  </U></B> and <B> . These tags do not belong to any token as "left" and "right" tag, so they were left in the output.

See also

Tags insertion mechanism,

Configuration file FORMAT TAGS section,

CASE SENSITIVE TAGS,

Predefined and User Group Tokens


USE ALL SPECIFICATIONS OF TAGS

Variable:  USE ALL SPECIFICATIONS OF TAGS

Possible values:  YES, NO

Default value:  NO

Has effect in:  Format Convertor

Description

There could be more tags to be inserted around some token (because that token belong to some groups of tokens which has records in FORMAT TAGS section of configuration file).

•	YES  -  All of these tags will be inserted to output.

•	NO  -  Only two tags will be inserted (one left and one right tag) - tags specified by record in the FORMAT TAGS section, which is the most important (the most concrete) for the token. By another words only last left tag (in the ordinary order) and first rigth tag is inserted.

See also

Tags insertion mechanism,

Configuration file FORMAT TAGS section,

Order of tags insertion,

Predefined and User Group Tokens


CASE SENSITIVE TAGS

Variable:  CASE SENSITIVE TAGS

Possible values:  YES, NO

Default value:  NO

Has effect in:  Format Convertor, if  REMOVE UNNECESSARY TAGS = YES

Description

When removing of corresponding right and left tags is on (REMOVE UNNECESSARY TAGS = YES), the Format Convertor must compare tags.

This comparison is:

•	YES  -  case sensitive.

•	NO  -  case insensitive.

See also

Tags insertion mechanism,

REMOVE UNNECESSARY TAGS


CASE SENSITIVE REPLACEMENTS

Variable:  CASE SENSITIVE REPLACEMENTS

Possible values:  YES, NO

Default value:  NO

Has effect in:  Format Convertor

Description

The Format Convertor performs replacement of text strings (let's call them FROM-strings) to another text strings.

The searching of FROM-strings should be:

•	YES  -  case sensitive.

•	NO  -  case insensitive.

See also

Text replacements,

Configuration file TEXT REPLACEMENTS section


INDENT ON STRING

Variable:  INDENT ON STRING

Default value:  *INDENT-ON*

Has effect in:  Indent

Description

The value of this variable is a string (let's call it ON-string), which switch on complete functionality of Indent when it is found (alone) in the comment in input source. For details see How to Switch Formatting On and Off.

The ON-string should be specified in this way:

INDENT ON STRING  =  "ON-string"

So for default ON-string it would be:

INDENT ON STRING  =  "*INDENT-ON*"

Remark: ON-string is considered to be "a quoted string" in the terms of this topic. For example if you want  ind\on  to be your ON-string, you must write:

INDENT ON STRING  =  "ind\\on" .

In input source should than appear for example:

{ ind\on }

See also

How to Switch Formatting On and Off,

INDENT OFF STRING,

Special meaning of backslash character in quotes


INDENT OFF STRING

Variable:  INDENT OFF STRING

Default value:  *INDENT-OFF*

Has effect in:  Indent

Description

The value of this variable is a string (let's call it OFF-string), which completely switch off the functionality of Indent when it is found (alone) in the comment in input source - the output will be identical with the input. For details see How to Switch Formatting On and Off.

The OFF-string should be specified in this way:

INDENT OFF STRING  =  "OFF-STRING"

So for default OF-string it would be:

INDENT OFF STRING  =  "*INDENT-OFF*"

Remark: OFF-string is considered to be "a quoted string" in the terms of this topic. For example if you want  ind\off  to be your OFF-string, you must write:

INDENT OFF STRING  =  "ind\\off" .

In input source should than appear for example:

{ ind\off }

See also

How to Switch Formatting On and Off,

INDENT ON STRING,

Special meaning of backslash character in quotes


LUC ON STRING

Variable:  LUC ON STRING

Default value:  *LUC-ON*

Has effect in:  Indent

Description

The value of this variable is a string (let's call it ON-string), which switch on mechanism for capitalizing and lowering of letters in identifiers and numbers when it is found (alone) in the comment in input source. For details see How to Switch Formatting On and Off.

The ON-string should be specified in this way:

LUC ON STRING  =  "ON-string"

So for default ON-string it would be:

LUC ON STRING  =  "*LUC-ON*"

Remark: ON-string is considered to be "a quoted string" in the terms of this topic. For example if you want  luc\on  to be your ON-string, you must write:

LUC ON STRING  =  "luc\\on" .

In input source should than appear for example:

{ luc\on }

See also

How to Switch Formatting On and Off,

Capitalizing and Lowering of Letters,

LUC OFF STRING,

Special meaning of backslash character in quotes


LUC OFF STRING

Variable:  LUC OFF STRING

Default value:  *LUC-OFF*

Has effect in:  Indent

Description

The value of this variable is a string (let's call it OFF-string), which switch off mechanism for capitalizing and lowering of letters in identifiers and numbers when it is found (alone) in the comment in input source. For details see How to Switch Formatting On and Off.

The OFF-string should be specified in this way:

LUC OFF STRING  =  "OFF-string"

So for default ON-string it would be:

LUC OFF STRING  =  "*LUC-OFF*"

Remark: OFF-string is considered to be "a quoted string" in the terms of this topic. For example if you want  luc\off  to be your OFF-string, you must write:

LUC OFF STRING  =  "luc\\off" .

In input source should than appear for example:

{ luc\off }

See also

How to Switch Formatting On and Off,

Capitalizing and Lowering of Letters,

LUC ON STRING,

Special meaning of backslash character in quotes


INCLUDE PATH

Variable:  INCLUDE PATH

Default value:  empty string ("")

Has effect in:  Indent, Format Convertor

Description

The variable should contain the path to include files (files, that are used in %INCLUDE_SECTION% command) in this way:

INCLUDE PATH = "path-string"

When an include file is to be open, the path is determined in this way: At first, the path of configuration file is taken. Than it is modified by INCLUDE PATH and than by the path of include file itself.

Remark: Path-string is not considered to be "a quoted string" in the terms of this topic. For example you should write

INCLUDE PATH = "C:\progs\includes"

and not

INCLUDE PATH = "C:\\progs\\includes" .

Example

Configuration file:

C:\progs\conf\myconfig.cfg

Include files:

C:\inc1.inc

C:\progs\includes\myinc\inc2.inc

C:\progs\includes\inc3.inc

In configuration file "myconfig.cfg" it could appear:

INCLUDE PATH = "..\includes"

.

.

%INCLUDE_SECTION% "C:\inc1.inc" : abc

%INCLUDE_SECTION% "myinc\inc2.inc" : abc

%INCLUDE_SECTION% "inc3.inc" : abc

See also

%INCLUDE_SECTION% command,

Special meaning of backslash character in quotes


USER GROUP TOKEN

Variable:  USER GROUP TOKEN

Has effect in:  Indent, Format Convertor

Description

USER GROUP TOKEN is not a classical variable. It doesn't contain any value. Every assignment to this variable is actually a declaration of a new User Group Token.

USER GROUP TOKEN  =  "new User Group Token"

Example

user group token  =  "keyword"

user group token  =  "operator"

See also

What are Group Tokens,

User Group Tokens


SPACES

Section:  SPACES

Content has effect in:  Indent

Description

SPACES section serves for setting up the mechanism for supression and enforcement of spaces around tokens or leaving an original state.

Syntax of one item (one line)

string  specification [priority] [ , specification [priority] ]

where:

string

Identifier (e.g. IF, i, AND), symbol (e.g. :=, ;) or Group Token  (e.g. "identifier"). This must not be concrete number, string or comment.

specification

•	left  :  enforcement of space on left side (before) of token

•	right  :  enforcement of space on right side (after) of  token

•	both  :  enforcement of space on both sides (after and before) of  token (it is equivalent to:  left, right)

•	noleft  :  supression of space on left side (before) of  token

•	noright  :  supression of space on right side (after) of  token

•	noboth  :  supression of space on both sides (after and before) of  token (it is equivalent to:  noleft, noright)

•	nochangeleft  :  leave original state on left side (before) of token

•	nochangeright  :  leave original state on right side (after) of token

•	nochangeboth  :  leave original state on both sides (after and before) of token (it is equivalent to:  nochangeleft, nochangeright)

priority

Number between -100 and 100. Default value (when priority is not stated) is  0.

The higher priority, the more "strong" is the specification when deciding about spaces between tokens. Here you can find more detailed description of usage.

In specifications nochangeleft, nochangeright a nochangeboth priority must not be stated (it would have no sence).

Difference between not entering the specification and specifications  nochange...

Difference between not entering the specification (either for one side or both sides of token) and specifications nochange... show itself when there are more items in SPACES section which should be applied to spaces around token (typically : token belongs to some group(s) of tokens represented by Group Token, which is also in SPACES section).

Let's have a part of configuration file:

[SPACES]

begin         left

"identifier"  both

We will look at the behaviour of the mechanism on the right side of BEGIN token. Because BEGIN is an identifier, record for "identifier" will be applied first (see more detailed description) - so FORCE space. After than the record for BEGIN itself is applied which doesn't say anything about right side - so FORCE space stays - and it is the final result.

No let's have this:

[SPACES]

begin         left, nochangeright

"identifier"  both

We are interested in the right side of BEGIN again. At first the record for "identifier" will be applied, so FORCE space. Now the record for BEGIN is taken and because of presence of nochangeright FORCE space is overwritten by LEAVE ORIGINAL STATE. The final result is LEAVE ORIGINAL STATE.

Summary: Not entering a specification means not intervening to mechanism which determines, whether spaces should be around token. Entering nochangeleft, nochangeright nebo nochangeboth mean an intervention to this mechanism and stating "leave original state".

Examples

user group token  =  "keyword"

[keyword]

begin

end

[SPACES]

"identifier"   both

"symbol"       both 1

"number"       both

"keyword"      noleft 3

+              noleft 4, noright

;              noleft 2

begin          nochangeright 1

..             nochangeboth

"(**)"         left

a              noleft 1, right 2

:=             noboth 2

Remark: Examples just show syntax possibilities of SPACES section, they have no connection with real usage.

Another example

See also

Spaces insertion mechanism,

Example for Spaces insertion mechanism,

What are Group Tokens


LOWER UPPER CASE

Section:  LOWER UPPER CASE

Content has effect in:  Indent

Description

LOWER UPPER CASE section contains "correct" forms of identifiers as far as case of letters is concerned. When an identifier is stated in this section then each of its occurrences will be transformed to the form, in which the identifier in written in this section. Also strings "NUMBER" and "number" can appear in the section - see Capitalizing and Lowering of Letters.

Example of setting of Mechanism for capitalizing and lowering of letters

See also

Capitalizing and Lowering of Letters,

LUC ON STRING,

LUC OFF STRING


PREFERRED EOL AFTER

Section:  PREFERRED EOL AFTER

Content has effect in:  Indent

Description

PREFERRED EOL AFTER specifies tokens, after which the PEOLA mechanism is active.

Section can contain of :

•	identifiers (e.g. IF , i , and , MyVal)

•	symbols (e.g. = , >= , ; , ( , .. )

•	Group Tokens (e.g. "IDENTIFIER") except predefined Group Token "ASSEMBLER"  ;  PEOLA is activated after every token from the group

Example

USER GROUP TOKEN  =  "keyword"

[keyword]

begin

end

[PREFERRED EOL AFTER]

and

or

:=

)

c

"keyword"

to

Example for PEOLA MODE

See also

Ends-of-lines and Line Wrapping, PEOLA mechanism,

PEOLA MODE,

What are Group Tokens,

Predefined Group Tokens


FORMAT TAGS

Section:  FORMAT TAGS

Content has effect in:  Format Convertor

Description

FORMAT TAGS section serves for defining tags, which are inserted before and after tokens (not only tokens but primarily tokens) by Format Convertor.

Syntax of one item (one line)

Entering both tags:

string  "left_tag"  "right_tag"

Entering only left tag:

string  "left_tag"

or

string  "left_tag"  -

Entering only right tag:

string  -  "right_tag"

where:

string

Identifier (e.g. IF, i, AND), symbol (e.g. :=, ;) or Group Token  (e.g. "identifier"). This must not be concrete number, string or comment. string  must not be empty.

left_tag

Tag, which will be inserted before token. ATTENTION! Backslash character ( \ ) has special meaning inside quotes!

right_tag

Tag, which will be inserted after token. ATTENTION! Backslash character ( \ ) has special meaning inside quotes!

Example of Tags insertion mechanism

See also

Tags insertion mechanism,

Special meaning of backslash character in quotes


TEXT REPLACEMENTS

Section:  TEXT REPLACEMENTS

Content has effect in:  Format Convertor

Description

In TEXT REPLACEMENTS section you can define, which text should be replaced by another one by Format Convertor

Syntax of one item (one line)

"old_text"  "old_text"

where:

old_text

Format Convertor will be finding this string in the original source (it can be case sensitive or case insensitive - see CASE SENSITIVE REPLACEMENTS) and will replace it by new_text string. Searching is line-oriented, Format Convertor will not try to find old_text splitted into more lines (first part on one line, the second on another) even if old_text contains escape sequence \n - see here.  old_text must not be empty.

new_text

String which will replace old_text.

ATTENTION! Backslash character ( \ ) has special meaning inside quotes!

Example of Text Replacements

See also

Text Replacements,

Special meaning of backslash character in quotes


Sections for Definition of Content of User Group Tokens

Names of these sections correspond to the names of User Group Tokens(without quotes) declared using USER GROUP TOKEN variable. The content of section is a list of tokens, which define "content" of the Group Token, that belongs to the section (has the same name).

Example

USER GROUP TOKEN  =  "keyword"

[KEYWORD]

begin

end

if

then

else

See also

What are Group Tokens,

USER GROUP TOKEN,

User Group Tokens


What are Group Tokens

What is it a Token

"Token" of a programming language is a word of this language such as identifier, operator, separator, string or number.

What is it a Group Token

"Group Token" is a special string (it is not a part of programming language, it is a term of Pascal Indent), which represents a group of Tokens. Why to establish this term? In Pascal Indent it is possible to set up behaviour of several formatting mechanisms for one concrete token (concretely Spaces insertion mechanism in Indent and Tags insertion mechanism in Format Convertor). But you can also use Group Token instead of concrete token in these mechanisms. Than it means that the behaviour you assigned to the Group Token will be used for all tokens from the group of tokens represented by that Group Token.

Notice: Group token are not related to the Pascal programming language at all. It is an only way how to identify a group of tokens in Pascal Indent.

Syntax of Group Tokens

Group Tokens are quoted, case insensitive, strings (ordinary tokens are just strings with no quotes). E.g.:

"IDENTIFIER"

"KEYWORD"

"MY IDENTIFIER"

Sorts of Group Tokens

Predefined Group Tokens,

User Group Tokens

Usage for Group Tokens

Spaces insertion mechanism,

Tags insertion mechanism


Predefined Group Tokens

Predefined Group Tokens represents basic syntactical groups of (not only) words of Pascal programming language.

•	"IDENTIFIER"  - represents all identifiers

•	"NUMBER"  - represents all numbers

•	"SYMBOL"  - represents operators, separators etc. (e.g.:  :=  .   ,   +   ..   etc.)

•	"STRING"  - represents all strings

•	"{}"  - represents all comments of type   {comment}

•	"(**)"  - represents all comments of type   (*comment*)

•	"//"  - (only in Delphi) represents all comments of type   //comment

•	"ASSEMBLER"  - represents all tokens of assembler (only for Format Convertor)

See also

What are Group Tokens,

User Group Tokens


Declaration of User Group Tokens and Definition of Their Content

Declaration of User Group Tokens

Declaration of User Group Tokens is performed by USER GROUP TOKEN variable. It is a pseudo-variable in fact, because it doesn't contain any value - Every assignment to this variable is actually a declaration of a new User Group Token.

user group token  =  "new group token"

Example:

user group token  =  "keyword"

user group token  =  "my identifier"

One concrete token (e.g. BEGIN, i, <, OF) can belong to more groups. In this case the order of declaration of appropriate User Group Tokens is important. First the "more general" ones should be declared and after then the "more concrete" ones. For example if we want to have BEGIN token in groups "keyword" and "block keyword", then the correct order of declarations is:

user group token  =  "keyword"

user group token  =  "block keyword"

Definition of "content" of User Group Tokens

The group of tokens itself (which will be represented by the User Group Token) should be defined as a section of configuration files. The name of section is the string of User Group Token without quotes. The content of section is a list of tokens, which are to be represented by the User Group Token.

Example:

Let's have "keyword" and "block keyword" User Group Tokens declared. The content of these groups is specified in configuration file in this way:

[keyword]

if

then

do

while

repeat

until

program

uses

begin

end

label

function

[block keyword]

begin

end

repeat

until

Forbidden names of User Group Tokens

"IDENTIFIER", "SYMBOL", "NUMBER", "STRING", "{}", "(**)", "//", "ASSEMBLER", "SPACES", "LOWER UPPER CASE", "PREFERRED EOL AFTER", "FORMAT TAGS", "TEXT REPLACEMENTS"

See also

What are Group Tokens,

Predefined Group Tokens,

USER GROUP TOKEN,

Sections for Definition of Content of User Group Tokens


Order of Records for Spaces Insertion and Tags Insertion

Here you can find, which records and in which order will be looked up in SPACES section of configuration file while finding space-rules around  token  and FORMAT TAGS section while finding tags, which should be inserted around token (it is the order for left tags insertion, right tags are inserted in reverse order). These records are different for different kinds of tokens:

For identifiers:

•	"IDENTIFIER"

•	User Group Tokens (in the order of their declaration) representing groups, which  token  belongs to

•	token

For symbols:

•	"SYMBOL"

•	User Group Tokens (in the order of their declaration) representing groups, which  token  belongs to

•	token

For numbers:

•	"NUMBER"

For strings:

•	"STRING"

For comments of type:  {comment} :

•	"{}"

For comments of type:  (*comment*) :

•	"(**)"

For comments of type:  //comment  (only in Delphi):

•	"//"

For tokens of assembler (only for Tags insertion mechanism in Format Convertor):

•	"ASSEMBLER"

Remark 1: String  token   represents one concrete token.

Remark 2: Quoted strings above are Predefined Group Tokens. How to define and use User Group Token you can find here.

See also

Spaces insertion mechanism,

Tags insertion mechanism


Example of Configuration File

PASIND.CFG

==========

MAX LENGTH OF LINE  =  200

TAB SIZE  =  8

# this is comment

IND BEFORE BEGIN  =  0

%INCLUDE_SECTION%  "INCLUDE.TXT" : VARIABLES

[LOWER UPPER CASE]

Begin

End

CONST

  #VAR   ... this is comment too

i

a

GreatestNumber

Divider

ShowCursor

[PREFFERED EOL AFTER]

ASSIGN

GET

PUT

%include_section%  "INCLUDE.TXT"

%include_section%  "INCLUDE.TXT" :  my identifiers

INCLUDE.TXT

===========

[MY IDENTIFIERS]

LIST

TABLE

INSERT

[another identifiers]

OPEN

CLOSE

FLUSH

[PREFFERED EOL AFTER]

FILE

HANDLE

ERROR

[VERIABLES]

COMMENTS MODE  =  1

REDUCE SPACES  =  yes


Example of Spaces Insertion Mechanism

Part of configuration file:

use all specifications of spaces  =  yes

user group token  =  "keyword"

[SPACES]

"identifier"   noright 2

"keyword"      both 1

if             right 3

(              noboth 2

[keyword]

if

begin

Program:

... if ( ....

We want to find out whether there should be space between  if and  ( .

Following things will be done ("space enforcement" = YES, "space supression" = NO, "original state" = NOTHING) :

1) finding space-rule on the right side of  if  token

•	initial setting: NOTHING, priority 0

•	if  is an identifier, so record for  "identifier"  is applied: NO, priority 2

•	seeking through User Group Tokens - if  is found in  "keyword", so record for "keyword" is applied: YES, priority 1

•	if is not found in any other User Group Token

•	application of record for  if  itself (the record is found in SPACES), so :  YES, priority 3

Result :  YES, priority 3

2) finding space-rule on the left side of  (  token.

•	initial setting: NOTHING, priority 0

•	( is a symbol, so record for  "symbol"  should be applied - should be but will not be, because  "symbol"  is not in SPACES section - so we don't change anything

•	seeking through User Group Tokens -  ( is not found anywhere - nothing is changed

•	application of record for  if  itself (the record is found in SPACES), so :  NO, priority 2

Result :  NO, priority 2

3) comparison of both results - (YES, 3) a (NO, 2)

Because 3 > 2 - priority of the first result is greater, so a space WILL BE inserted.


Example of Mechanism for Capitalizing and Lowering of Letters

Part of configuration file:

FIRST OCCURENCE DECIDE  =  YES

[LOWER UPPER CASE]

BEGIN

END

If

Then

"NUMBER"

Y

Original source:

Begin

  if x = y then WriteLn(x);

  if X > y then WRITEln($ac);

End;

Output:

BEGIN

  If x = Y Then WriteLn(x);

  If x > Y Then WriteLn($AC);

END;


Example of Tags Insertion Mechanism in Format Convertor

Part of configuration file:

USE ALL SPECIFICATIONS OF TAGS  =  YES

REVERSE TAGS ORDER  =  NO

REMOVE UNNECESSARY TAGS  =  NO

USER GROUP TOKEN  =  "KEYWORD"

USER GROUP TOKEN  =  "SPECIAL KEYWORD"

[KEYWORD]

begin

end

if

then

[SPECIAL KEYWORD]

begin

end

[FORMAT TAGS]

begin              "<U>"  "</U>"

"keyword"          "<B>"  "</B>"

"special keyword"  "<I>"  "</I>"

"file"             "<HTML><BODY><PRE>"  "</PRE></BODY></HTML>"

"string"           "<I>"  "</I>"

"identifier"       "<U>"  "</U>"

Original source:

begin

  if x = y then Writeln("Equal");

end;

Output of Format Convertor:

<HTML><BODY><PRE>

<U><I><B><U>begin</U></B></I></U>

  <B><U>if</U></B> <U>x</U> = <U>y</U> <B><U>then</U></B> <U>Writeln</U>(<I>"Equal"</I>);

<I><B><U>end</U></B></I>;

</PRE></BODY></HTML>


Example for Text Replacements in Format Convertor

Part of configuration file:

CASE SENSITIVE REPLACEMENTS  =  NO

[TEXT REPLACEMENTS]

"<"  "&lt"

">"  "&gt"

Original source:

begin

  if x > y then x := x - y

  else if x < y then y := y - x

  else exit;

end;

Output:

begin

  if x &gt y then x := x - y

  else if x &lt y then y := y - x

  else exit;

end;


Example for PEOLA MODE

Example just shows possibilities of PEOLA mechanism, it has no connection with real usage.

Part of configuration file:

INSIZE CONTINUOUS LINE = 4

USER GROUP TOKEN = "keyword"

[KEYWORD]

if

[PREFERRED EOL AFTER]

and

"keyword"

=

+

Original source:

begin

  if (a>MaximumValue)and(b=MaximumValue)and(c<MaximumValue) then

  begin

    c:=d;

    Exit;

  end;

end;

Output - PEOLA MODE = 0

begin                                              |

  if (a > MaximumValue) and (b =                   |

      MaximumValue) and (c < MaximumValue) then    |

  begin                                            |

    c := a * b + d * e;                            |

    Exit;                                          |

  end;                                             |

end;                                               |

Remark: Vertical lines on the right show the position of right limit.

Výstup - PEOLA MODE = 1

begin

  if

  (a > MaximumValue) and

  (b =

  MaximumValue) and

  (c < MaximumValue) then

  begin

    c := a * b +

    d * e;

    Exit;

  end;

end;

Výstup - PEOLA MODE = 2

begin

  if

      (a > MaximumValue) and

      (b =

      MaximumValue) and

      (c < MaximumValue) then

  begin

    c := a * b +

        d * e;

    Exit;

  end;

end;


Example of Comments Formatting according to COMMENTS MODE Setting

Original source:

begin

  if a = {b} c then    {equal}

  begin

    Writeln("Values are equal");  {write result to output}

    Exit;

  end;

end;

Output - COMMENTS MODE = 0

begin

    if a =

{b}

    c then

{equal}

    begin

        Writeln( "Values are equal" );

{write result to output}

        Exit;

    end;

end;

Output - COMMENTS MODE = 1

begin

    if a =

    {b}

    c then

    {equal}

    begin

        Writeln( "Values are equal" );

        {write result to output}

        Exit;

    end;

end;

Output - COMMENTS MODE = 2

begin

    if a = {b} c then

    {equal} begin

                  Writeln( "Values are equal" );

                  {write result to output} Exit;

              end;

end;

Output - COMMENTS MODE = 3

begin

    if a = {b} c then  {equal}

    begin

        Writeln( "Values are equal" ); {write result to output}

        Exit;

    end;

end;

Output - COMMENTS MODE = 4

begin

    if a = {b} c then  {equal}

    begin

        Writeln( "Values are equal" );

                                     {write result to output}

        Exit;

    end;

end;


Example of Comments Formatting according to FIRST COMMENTS MODE Setting

Original source:

  begin

    if (a = b) and (c = d) and

{+}    (e = f) then

{*} begin

      Writeln("Values are equal");

{**}  Exit;

    end;

  end;

Output - FIRST COMMENTS MODE = 0

  begin

    if (a = b) and (c = d) and {+} (e = f) then

    {*} begin

          Writeln("Values are equal");

          {**} Exit;

        end;

  end;

Output - FIRST COMMENTS MODE = 1

  begin

    if (a = b) and (c = d) and

{+}   (e = f) then

{*} begin

      Writeln("Values are equal");

{**}  Exit;

    end;

  end;


Example for REMOVE REDUNDANT EMPTY LINES

Original source:

begin

  if (a = b)

     and

     (c = d) then

  begin

    c := a;

  end;

end;

Output - REMOVE REDUNDANT EMPTY LINES = NO

begin

  if (a = b)

     and

     (c = d) then

  begin

    c := a;

  end;

end;

Output - REMOVE REDUNDANT EMPTY LINES = YES

begin

  if (a = b) and (c = d) then

  begin

    c := a;

  end;

end;


Example for IND BEFORE BEGIN

IND BEFORE BEGIN = 0

procedure Foo;

begin

  Writeln;

  Writeln;

  begin

    Writeln('Hello');

    Writeln('Bye');

  end;

end;

IND BEFORE BEGIN = 1

procedure Foo;

  begin

    Writeln;

    Writeln;

      begin

        Writeln('Hello');

        Writeln('Bye');

      end;

  end;


Example for IND AFTER BEGIN

IND AFTER BEGIN = 0

INDSIZE AFTER BEGIN = 4

procedure Foo;

begin

    Writeln;

    Writeln;

    begin

        Writeln('Hello');

        Writeln('Bye');

    end;

end;

IND AFTER BEGIN = 1

INDSIZE AFTER BEGIN = 7

procedure Foo;

begin  Writeln;

       Writeln;

       begin Writeln('Hello');

             Writeln('Bye');

       end;

end;

IND AFTER BEGIN = 2

procedure Foo;

begin

Writeln;

Writeln;

begin

Writeln('Hello');

Writeln('Bye');

end;

end;


Examples of Formatting of BEGIN...END Block

IND BEFORE BEGIN = 0

IND AFTER BEGIN = 0

procedure Foo;

begin

  Writeln;

  Writeln;

  begin

    Writeln('Hello');

    Writeln('Bye');

  end;

end;

IND BEFORE BEGIN = 0

IND AFTER BEGIN = 1

INDSIZE AFTER BEGIN = 7

procedure Foo;

begin  Writeln;

       Writeln;

       begin  Writeln('Hello');

              Writeln('Bye');

       end;

end;

IND BEFORE BEGIN = 1

IND AFTER BEGIN = 2

procedure Foo;

  begin

  Writeln;

  Writeln;

    begin

    Writeln('Hello');

    Writeln('Bye');

    end;

  end;

IND BEFORE BEGIN = 1

IND AFTER BEGIN = 0

procedure Foo;

  begin

    Writeln;

    Writeln;

       begin

         Writeln('Hello');

         Writeln('Bye');

       end;

  end;


Example for IND BEFORE THEN

IND BEFORE THEN = 0

if a = b then Writeln;

IND BEFORE THEN = 1

if a = b

then Writeln;


Example for IND AFTER THEN NORM

IND AFTER THEN NORM = 0

if a = b then Writeln;

IND AFTER THEN NORM = 1

INDSIZE AFTER THEN NORM = 4

if a = b then

    Writeln;


Example for IND AFTER THEN BEGIN

IND AFTER THEN BEGIN = 0

IND BEFORE BEGIN = 0

if a = b then

begin

  Writeln('Hello');

  Writeln('Bye');

end;

IND AFTER THEN BEGIN = 0

IND BEFORE BEGIN = 1

INDSIZE AFTER THEN BEGIN = 5

if a = b then

     begin

       Writeln('Hello');

       Writeln('Bye');

     end;

IND AFTER THEN BEGIN = 1

IND BEFORE BEGIN = 0

INDSIZE AFTER THEN BEGIN = 3

if a = b then

   begin

     Writeln('Hello');

     Writeln('Bye');

   end;

IND AFTER THEN BEGIN = 2

if a = b then begin

                Writeln('Hello');

                Writeln('Bye');

              end;

IND AFTER THEN BEGIN = 3

if a = b then begin

  Writeln('Hello');

  Writeln('Bye');

end;


Example for IND AFTER THEN IF

IND AFTER THEN IF = 0

if a = b then if c = d then

              begin

                Writeln('Hello');

                Writeln('Bye');

              end;

if e = f then if g = h then Writeln('Hello');

for x := 1 to 10 do if a = x then Writeln('Bye');

IND AFTER THEN IF = 1

if a = b then

if c = d then

begin

  Writeln('Hello');

  Writeln('Bye');

end;

if e = f then

if g = h then Writeln('Hello');

for x := 1 to 10 do

if a = x then Writeln('Bye');

IND AFTER THEN IF = 2

INDSIZE AFTER THEN IF = 3

if a = b then

   if c = d then

   begin

     Writeln('Hello');

     Writeln('Bye');

   end;

if e = f then

  if g = h then Writeln('Hello');

for x := 1 to 10 do

  if a = x then Writeln('Bye');


Example for IND AFTER ELSE NORM

IND AFTER THEN NORM = 0

IND AFTER ELSE NORM  not set (default value ... 0)

if a = b then Writeln;

else Exit;

IND AFTER THEN NORM = 0

IND AFTER ELSE NORM = 1

INDSIZE AFTER ELSE NORM = 3

if a = b then Writeln;

else

   Exit;

IND AFTER THEN NORM = 1

IND AFTER ELSE NORM = 0

if a = b then

  Writeln;

else Exit;


Example for IND AFTER ELSE BEGIN

IND AFTER THEN BEGIN = 0

IND AFTER ELSE BEGIN = 0

if a = b then

begin

  Writeln('Hello');

  Writeln('Foo');

end

else

begin

  Writeln('Bye');

  Exit;

end;

IND AFTER THEN BEGIN = 0

IND BEFORE BEGIN = 0

IND AFTER ELSE BEGIN = 1

INDSIZE AFTER ELSE BEGIN = 4

if a = b then

begin

  Writeln('Hello');

  Writeln('Foo');

end

else

    begin

      Writeln('Bye');

      Exit;

    end;

IND AFTER THEN BEGIN = 0

IND BEFORE BEGIN = 1

IND AFTER ELSE BEGIN = 2

if a = b then

  begin

    Writeln('Hello');

    Writeln('Foo');

  end

else begin

       Writeln('Bye');

       Exit;

     end;

IND AFTER THEN BEGIN = 3

IND AFTER ELSE BEGIN = 3

if a = b then begin

  Writeln('Hello');

  Writeln('Foo');

end

else begin

  Writeln('Bye');

  Exit;

end;


Example for IND AFTER ELSE IF

IND AFTER THEN IF = 0

IND AFTER ELSE not set (default value = 0)

if a = b then if c = d then

              begin

                Writeln('Hello');

                Writeln('Foo');

              end

else if c <> d then

     begin

       Writeln('Bye');

       Exit;

     end

     else for x := 1 to 10 do if a = x then Writeln('Bye bye');

IND AFTER THEN IF = 1

IND AFTER ELSE IF = 1

if a = b then

if c = d then

begin

  Writeln('Hello');

  Writeln('Foo');

end

else

if c <> d then

begin

  Writeln('Bye');

  Exit;

end

else

for x := 1 to 10 do

if a = x then Writeln('Bye bye');

IND AFTER THEN IF = 2

IND AFTER ELSE IF = 2

INDSIZE AFTER ELSE IF = 3

if a = b then

   if c = d then

   begin

     Writeln('Hello');

     Writeln('Foo');

   end

else

   if c <> d then

   begin

     Writeln('Bye');

     Exit;

   end

   else

      for x := 1 to 10 do

         if a = x then Writeln('Bye bye');


Example for IND IN CASE NORM

IND IN CASE NORM = 0

case a of

  1 : Writeln;

  2, 3 : Exit;

end;

IND IN CASE NORM = 1

INDSIZE AFTER LABEL IN CASE = 3

case a of

  1 :

     Writeln;

  2, 3 :

     Exit;

end;


Example for IND IN CASE BEGIN

IND IN CASE BEGIN = 0

case a of

  1 : begin

        Writeln('Hello');

        Writeln('Foo');

      end;

  2, 3 : begin

           Writeln('Bye');

           Exit;

         end;

end;

IND IN CASE BEGIN = 1

INDSIZE AFTER LABEL IN CASE = 3

case a of

  1 :

     begin

       Writeln('Hello');

       Writeln('Foo');

     end;

  2, 3 :

     begin

       Writeln('Bye');

       Exit;

     end;

end;


Example for IND IN CASE IF

IND IN CASE IF = 0

case a of

  1 : if a = b then

      begin

        Writeln('Hello');

        Writeln('Foo');

      end;

  2, 3 : case b of

           1 : Writeln('A');

           2 : Writeln('B');

           else Writeln('Error');

         end;

end;

IND IN CASE IF = 1

case a of

  1 :

    if a = b then

    begin

      Writeln('Hello');

      Writeln('Foo');

    end;

  2, 3 :

    case b of

      1 : Writeln('A');

      2 : Writeln('B');

      else Writeln('Error');

    end;

end;


Example for IND LABELS IN CASE

IND LABELS IN CASE = 0

INDSIZE BEFORE LABEL IN CASE = 4

INDSIZE AFTER LABEL IN CASE = 6

IND IN CASE BEGIN = 1

case a of

    'A'..'F', '1', '2', '3' :

          begin

            Writeln('Hello');

            Writeln('Foo');

          end;

    'G'..'Z', '6', '7', '8' :

          begin

            Writeln('Bye');

            Exit;

          end;

end;

IND LABELS IN CASE = 1

INDSIZE BEFORE LABEL IN CASE = 4

INDSIZE AFTER LABEL IN CASE = 6

IND IN CASE BEGIN = 1

case a of

    'A'..'F',

    '1',

    '2',

    '3' :

          begin

            Writeln('Hello');

            Writeln('Foo');

          end;

    'G'..'Z',

    '6',

    '7',

    '8' :

          begin

            Writeln('Bye');

            Exit;

          end;

end;


Example for IND RECORD

IND RECORD = 0

type

  TPoint = record

    X : Integer;

    Y : Integer;

  end;

IND RECORD = 1

INDSIZE IN RECORD = 4

type

  TPoint = record

               X : Integer;

               Y : Integer;

           end;


Example for IND CASE IN RECORD

IND CASE IN RECORD = 0

type

  TData = record

    X : Integer;

    case A : Byte of

      1 : (Y, Z : Integer; B : Byte);

      2 : (U : Integer; case Byte of

                          1 : (H : Byte; I : Byte);

                          2 : (J : Real))

  end;

IND CASE IN RECORD = 1

type

  TData = record

    X : Integer;

    case A : Byte of

      1 : (Y, Z : Integer;

           B : Byte);

      2 : (U : Integer;

           case Byte of

             1 : (H : Byte;

                  I : Byte);

             2 : (J : Real))

  end;

IND CASE IN RECORD = 2

type

  TData = record

    X : Integer;

    case A : Byte of

      1 : (

        Y, Z : Integer;

        B : Byte);

      2 : (

        U : Integer;

        case Byte of

          1 : (

            H : Byte;

            I : Byte);

          2 : (J : Real))

  end;


Example for IND PROCEDURE IN PROCEDURE

IND PROCEDURE IN PROCEDURE = 0

function Load(F : File) : Integer;

var S :String;

    x :Integer;

procedure GetString;

begin

  ReadLn(F, S);

end;

begin

  for x := 1 to 10 do GetString;

end;

IND PROCEDURE IN PROCEDURE = 1

INDSIZE PROCEDURE IN PROCEDURE = 3

function Load(F : File) : Integer;

var S :String;

    x :Integer;

   procedure GetString;

   begin

     ReadLn(F, S);

   end;

begin

  for x := 1 to 10 do GetString;

end;


Example for IND LABELS

IND LABELS = 0

label Jump;

begin

   begin

      begin

         if a = b then goto Jump;

      end;

      Writeln;

   Jump:

      Writeln;

   end;

end;

IND LABELS = 1

label Jump;

begin

   begin

      begin

         if a = b then goto Jump;

      end;

      Writeln;

   Jump: Writeln;

   end;

end;

IND LABELS = 2

label Jump;

begin

   begin

      begin

         if a = b then goto Jump;

      end;

      Writeln;

Jump:

      Writeln;

   end;

end;

IND LABELS = 3

label Jump;

begin

   begin

      begin

         if a = b then goto Jump;

      end;

      Writeln;

Jump: Writeln;

   end;

end;


Example for IND USES

IND USES = 0

uses Dos, Crt, Graph;

IND USES = 1

uses

  Dos,

  Crt,

  Graph;


Example for IND ASSEMBLER

Original source:

begin

begin

  asm

     MOV AX, BX

     CMP AX, 10

     JNZ @1

     MOV CX, DX

     JMP @2

@1:  ADD AX, 2

     MOV CX, BX

@2:

     INC CX

  end;

end;

end;

IND ASSEMBLER = 0

begin

   begin

      asm

     MOV AX, BX

     CMP AX, 10

     JNZ @1

     MOV CX, DX

     JMP @2

@1:  ADD AX, 2

     MOV CX, BX

@2:

     INC CX

      end;

   end;

end;

IND ASSEMBLER = 1

INDSIZE AFTER ASM = 6

begin

   begin

      asm

            MOV AX, BX

            CMP AX, 10

            JNZ @1

            MOV CX, DX

            JMP @2

            @1:  ADD AX, 2

            MOV CX, BX

            @2:

            INC CX

      end;

   end;

end;


Example for IND AFTER CTV

IND AFTER CTV = 0

INDSIZE AFTER CONST = 6

INDSIZE AFTER TYPE = 5

INDSIZE AFTER VAR = 4

const a = 1;

      b : Byte = 2;

type MyInt = Integer;

     TPoint = record

       X : Integer;

       Y : Integer;

     end;

var U : Real;

    i : Integer;

IND AFTER CTV = 1

INDSIZE AFTER CONST = 4

const

    a = 1;

    b : Byte = 2;

type

  MyInt = Integer;

  TPoint = record

    X : Integer;

    Y : Integer;

  end;

var

  U : Real;

  i : Integer;


Keywords which are Important for Pascal Indent

Pascal Indent doesn't perform complete syntactical analysis of Pascal language, therefore it is able to format different dialects of this language. But main syntactical rules of Pascal must still be kept.

Pascal Indent is written to be able to format primarily two dialects: Borland Pascal 7 and Inprise Delphi 5. Which one of them is expected is determined by value of DELPHI variable. Here are keywords and standard directives which are "orientation points" for Pascal Indent:

DELPHI = NO  (Borland Pascal 7)

asm

begin

case

const

constructor

destructor

do

else

end

exports

for

function

if

implementation

inline

interface

label

library

object

of

procedure

program

record

repeat

then

type

unit

until

uses

var

while

with

external

forward

private

public

DELPHI = YES  (Inprise Delphi 5)

All keywords and standard directives for  DELPHI = NO  and these additional:

class

dispinterface

except

finalization

finally

initialization

property

resourcestring

threadvar

try

automated

on

protected


Troubleshooting

Errors while reading configuration file

Reason: Wrong syntax of configuration file or the values of variables are out of bounds.

Solution: Read documentation carefully.

Errors while processing input file

Possible reason: Input source do not match syntax of Borland Pascalu 7 or Inprise Delphi 5 an it is not even similar enough.

Solution: Appropriate setting of DELPHI variable. You can also try to rewrite the input source. See also Keywords important for  Pascal Indent.

Possible reason: Input source contains conditional compilation directives (e.g. $IFDEF) and when ignoring them (Pascal Indent does so) the syntactical structure of program is corrupted.

Solution: Rewrite the source so that it has correct syntax even if the compilation directives are ignored (this is not related to semantics).

Possible reason: Input source contains compilation directive, which includes another file ($L name_of_file). Without this include, the source code doesn't match the syntax of Pascal.

Solution: Rewrite the source so that it has correct syntax even if the compilation directives are ignored (there is no file including).

Possible reason: Wrong setting of configuration variables.

Solution: See MAX LENGTH OF LINE, INPUT TAB SIZE.

It is not possible to compile resulting source code

Possible reason: Pascal makes it possible to write characters (values of CHAR type) not only using its ASCII code (e.g. #200, #$4A), but also using sequence: character  ^  followed by any character (e.g. ^A, ^1, ^! etc.). Pascal Indent can recognize this sequence only when  ^  is followed by letter or number. In other cases the sequence is not recognized and space can be inserted between  ^  and following character (e.g. ^ " or ^ !).

Solution: Do not use this obscure notation of CHARs or remove spaces between  ^  and following character manually.

Possible reason: Even the input source code cannot be compiled.

Solution: Modify the code to be correct for your compiler.

Formatting is not the one you expected

Symptom: EOLs are not inserted near right limit but more to the left (lines are often short).

Possible reason: Wrong setting of PEOLA mechanism.

Possible reason: Wrong setting of right limits - SOFT LIMIT, HARD LIMIT, SOFT LIMIT FOR COMMENTS.

Possible reason: EOLs are inserted only on spaces - see EOLS ONLY ON SPACES.

Possible reason: EOLs are inserted so that lines don't begin with commas and semicolons - see NO LEADING COMMAS AND SEMICOLONS.

Possible reason: EOLs from the input source are preserved - see KEEP ALL EOLS.

Symptom: Unsuitable formatting of CONST, TYPE, VAR, OBJECT or RECORD blocks.

Possible reason: The mechanism for leaving equal signs(=) and colons(:) under each other is on - see IND CTV FORMAT.

Symptom: Unsuitable formatting of constant arrays and constant structures of RECORD type.

Possible reason: See setting of IND CONSTANT STRUCTURES.

Symptom: Formatting of comments is strange.

Possible reason: See Formatting of comments, COMMENTS MODE or FIRST COMMENTS MODE.

Symptom: Unexpected splitting and joining of strings.

Possible reason: See SEVER STRINGS, SEVER STRINGS ONLY ON SPACES.

Symptom: Not indented or badly formatted assembler.

Possible reason: See Formatting of assembler, IND ASSEMBLER.

Other problems

Possible reason: There is a bug in Pascal Indent.

Solution: Contact author or find and patch it by yourself.


Introduction to GUI - Pascal Indent for Windows
Introduction to Graphic User Interface of Pascal Indent

Graphic User Interface of Pascal Indent, called Pascal Indent for Windows, was developed to simplify using of Pascal Indent. Main feature of the GUI is a possibility to edit and modify configuration file for Pascal Indent. It can also run Indent or Format Convertor (DLL version of Pascal Indent engine). A management for include files is introduced here. You can also use some predefined styles of keywords, standard directives and standard types as far as a case of letters is concerned.

Because the most of functionality consist of dialog supported editing of variables and sections of configuration file, I will not write documentation for this again. It would be just a repetition of configuration file description. Here you can find only new features.

Pascal Indent for Windows stores some additional information in configuration and include files as specially formatted comments. Do not corrupt them if you want the program to work properly.

See also

What is Pascal Indent


Predefined part of LOWER UPPER CASE section
Predefined Part of LOWER UPPER CASE Section (GUI)

In Pascal Indent for Windows it is possible to choose a predefined formatting (as far as a case letters is concerned) separately for keywords, standard directives and standard types. The result is of course influenced by value of DELPHI variable. This functionality is implemented using Predefined include files.

You can choose from:

•	No change

•	All characters lower case

•	All characters upper case

•	First character capital, other lower case

•	As recommended in Pascal/Delphi documentation  (only for Standard Types)

See also

Configuration file LOWER UPPER CASE section,

DELPHI,

Predefined include files


Introduction to include files
Introduction to Include Files (GUI)

Include files are something like units or modules. They should make multiple creation of configuration files more effective, they are to be used repeatedly. You can store parts of sections in them.

Their syntax is identical with an ordinary configuration file, only the first part with defintion of variables is missing - include files consist only of sections (there can be variables before the first section, but they are ignored). Name of sections can be arbitrary, it should just match syntactic rules for name of sections in configuration file. Sections can be included by %INCLUDE_SECTION% command to any place of configuration file, even to the variables-definition part. The syntax of content of the sections should match the syntax of sections (or variables-definition part), which they will be included into.

Remark: It is not allowed to use %INCLUDE_SECTION% command in section, which is been included itself.

Pascal Indent for Windows stores additional information about every section in include file. These are placed in the first comment after header of section:

[ name_of_section ]

# [ type_of_section ] description_of_section

This info is ignored by executive engine (it is just a comment), but it is used in GUI for transparent management of include files and their sections.

Type of section retains information about syntax of the section. By another words, to which part of configuration file the section is to be included. We have these types of sections:

•	VARIABLES

•	SPACES

•	LOWER UPPER CASE

•	PREFERRED EOL AFTER

•	FORMAT TAGS

•	TEXT REPLACEMENTS

•	USER GROUP TOKEN

See also

%INCLUDE_SECTION%,

Global include files,

Local include files,

Predefined include files


Global include files
Global Include Files (GUI)

Global include files are in GUI pernamently, they don't change when a configuration file is imported. They should have absolute paths. Info about them is stored in registry of Windows.

There are several possibilities how to handle with them when the configuration file is exported.

Be careful when Global include file has relative path, because Global include file is still an ordinary include file, so this relative path is relative to INCLUDE PATH variable which is relative to path of configuration file (here represented by Main Directory).

Remark: When an include file was not found, then its name and description is red. You can actualize this information using "Actualize" button.

See also

INCLUDE PATH,

Main Directory,

Configuration file export options,

Introduction to include files,

Local include files


Local include files
Local Include Files (GUI)

Local include files are include files which are used (or will be used) in actual (interior) configuration file. They are reset when a configuration file is imported. Information about them is loaded from %INCLUDE_SECTION% commands and from special records in configuration file.

Names of Local include files can have absolute paths, but it is often suitable to use relative paths. These names are (in certain case) inserted directly to configuration file, so when they have relative paths (and are really placed "relatively" to configuration file, for example in the same directory), then it is possible to relocate the complete "configuration-pack" (configuratin file and include files), use it on another computer etc. Relative paths are relative to value of INCLUDE PATH variable which is relative to path (placement) of configuration file. In the GUI, the placement of configuration file is unknown (you can export configuration file to any directory), hence Main Directory is used instead.

Remark: When an include file was not found, then its name and description is red. You can actualize this information using "Actualize" button.

There are two possibilities how to handle with Local include files when the configuration file is exported.

See also

%INCLUDE_SECTION%,

INCLUDE PATH,

Main Directory,

Configuration file export options,

Introduction to include files,

Global include files


Predefined include files
Predefined Include Files (GUI)

Predefined include files are part of Pascal Indent for Windows and are used for some additional formatting, which can be set up only in GUI. Now those are files for unified case of letters of keywords, standard directives and standard types - for LOWER UPPER CASE section.


Main Directory
Main Directory (GUI)

Main Directory  is "virtual path" for interior configuration file of GUI Pascal Indent for Windows.

In executive part of Pascal Indent, the placement of configuration file (in which directory it is) is important when names of include files with relative paths are used. These relative paths are relative to value of INCLUDE PATH variable which is relative to path (placement) of configuration file. In the GUI, the placement of configuration file is unknown (you can export configuration file to any directory), hence value of  Main Directory  is used instead.

When a configuration file is imported, Main Directory  is changes to the path of that file.

It is highly recommended to set  Main Directory  to path, which will be used for export of configuration file, because GUI will then look for an include files with relative paths in the same directories as finally exported configuration file.

See also

INCLUDE PATH,

Introduction to include files


Configuration file export options
Configuration File Export Options (GUI)

Configuration Variables

Export commented lines

When checked, the variables which were not used are exported as comments. Otherwise these variables will not appear in exported configuration file at all.

Don't export variables with default values

When checked, only the variables whose values differ from default values are exported. Otherwise all used variables are exported.

Global and predefined include files treatment in %INCLUDE_SECTION% command

1) Insert %INCLUDE_SECTION% with path and name of file as they are

%INCLUDE_SECTION% commands, that include sections of Global include files, will remain as they were in GUI. Sections of Predefined include files will be included using %INCLUDE_SECTION% commands with absolute paths to files.

2) Copy file to local directory and insert %INCLUDE_SECTION% with relative path

Used Global and Predefined include files will be copied to the Directory you specified. You can choose whether to copy complete files (all sections) or just parts of them (sections, that were included to configuration file). As Directory you can enter any directory (it is a path, in fact). When this directory is relative, then it is relative to value of INCLUDE PATH variable which is relative to path (placement) of exported configuration file. Directory will be path of all Global and Predefined include files in %INCLUDE_SECTION% commands. When a file is not found and cannot be copied, then the behaviour of first option is used.

3) Insert appropriate section of include file directly into configuration file (process command)

If an appropriate include file is found (it exists) and its requested section too, then the content of the section is inserted into exported configuration file instead of %INCLUDE_SECTION% command - the command is processed now. If the file or its section is not found, then the behaviour of first option is used.

Local and unknown include files treatment in %INCLUDE_SECTION% command

1) Insert %INCLUDE_SECTION% with path and name of file as they are

%INCLUDE_SECTION% commands, that include sections of Local include files or unknown files, will remain as they were in GUI.

2) Insert appropriate section of include file directly into configuration file (process command)

If an appropriate include file is found (it exists) and its requested section too, then the content of the section is inserted into exported configuration file instead of %INCLUDE_SECTION% command - the command is processed now. If the file or its section is not found, then the behaviour of first option is used.

See also

%INCLUDE_SECTION%,

Global include files,

Local include files,

Predefined include files,

INCLUDE PATH