How to use PALCMD.EXE

Top  Previous  Next

 

The standalone command-line version PALCMD.EXE is useful when you want to automate the process of creating reports. PALCMD.EXE uses the same engine as the GUI version PAL.EXE and produces the same output.

 

Run PALCMD.EXE from the command prompt using the following syntax:

 

PALCMD projectpath|sourcepath [options]

 

Option

Explanation

/A+        

Parse both source/form files

/A-

Parse source files only

/FA

Parse all files

/FR

Parse main file and directly used files

/FM

Parse main file only

/Q

Quiet mode



/CBP        

Borland Pascal 7 (or earlier)

/CD1

Delphi 1

/CD2

Delphi 2

/CD3

Delphi 3

/CD4

Delphi 4

/CD5

Delphi 5

/CD6

Delphi 6

/CD7

Delphi 7

/CD8

Delphi 8 for .NET

/CD9W

Delphi 2005 for Win32

/CD9N

Delphi 2005 for .NET

/CD10W

Delphi 2006 for Win32 (also Turbo Delphi for Win32)

/CD10N

Delphi 2006 for .NET   (also Turbo Delphi for .NET)

/CD11W

Delphi 2007 for Win32

/CD11N

Delphi 2007 for .NET

/CD12W

Delphi 2009 for Win32

/CD14W

Delphi 2010 for Win32

/CDXEW

 

Delphi XE for Win32

/F=format

/F=T -> text, /F=H -> HTML, /F=X -> XML

/L=path

Path to text file with limit info (/L=C:\PAL\Limits.txt)

/R=path

Report root folder (/R=C:\Out or /R="C:\My Out")

/S=folders

Search folders (/S="C:\CODE1;C:\My Code")')

/T=n

Number of report threads 1-64

 

Options are read from the project file. Some of the settings may be overridden by options on the command-line (see above).

 

The command-line version can, in contrast to the GUI version, also analyze source code without first creating a project. Just supply a source code path on the command-line instead of a project path. PALCMD will then use the settings according to the template which is used for new projects. These settings are in PAL.INI which is located in C:\Documents and Settings\<acc>\Application Data\Peganza\Pascal Analyzer.

 

The PAL.INI file is specially handled by PALCMD. If a PAL.INI file exists in the same folder as the program file itself, it will read the PAL.INI file from that location, otherwise it will read it from the same folder as the GUI program does. The GUI program will read the PAL.INI file from the special folder under "C:\Documents and Settings". In this way, if you keep the PALCMD.EXE in a special folder, you can make sure that it always uses the correct default options, by copying the PAL.INI file to that folder. This PAL.INI file will then not be affected of any changes that you happen to make while running the GUI program.

 

If an error occurs when PALCMD is run, the application terminates with exit code 99.

 

Example:

 

PALCMD

 

Shows help info and stops

 

PALCMD C:\projects\MyProj.pap

 

Runs PALCMD and analyses c:\projects\MyProj.pap

 

PALCMD "C:\My Units\MyUnits.pas" /F- /CBP

 

Runs PALCMD and analyses C:\My Units\MyUnits.pas with defaults as set in PAL.INI, but specifies that only the main file should be parsed, and that the compiler target is Borland Pascal 7.

 

PALCMD "C:\My Units\MyUnits.pas" /L=C:\PALCMD\Limits.txt

 

 

/F specifies the report format (text, HTML, XML)

 

This setting overrides the setting in the PAL.INI file or the project file.

 

 

/L specifies the path to a text file with limit info, in this case C:\PALCMD\Limits.txt.

 

For example, if the file contains this line:

 

WARN1=5

 

.. "WARN1" is the abbreviation for the section "'Interfaced identifiers that are used, but not outside of unit" in the Warnings Report.

If then the number of warnings in a particular run of PALCMD.EXE exceeds 5, PALCMD.EXE will write out an error, and halt with an exit code of 99.

 

You can add how many lines as you wish to the limit file. Each line will be checked against the specified section and report.

This feature is not available in PAL.EXE (GUI program).

 

 

/R specifies the report root folder

 

This setting overrides the setting in the PAL.INI file or the project file.

 

 

/S specifies search folders, separated with a semicolon

 

This setting overrides the setting in the PAL.INI file or the project file.

 

 

/T specifies the number of report threads to use

 

This setting overrides the setting in the PAL.INI file

 

 

See also: